Documentation: Link man pages to https://man7.org/
v3 cover Documentation: Link man pages to https://man7.org/
Changes v1->v2:
* Remove ... (italic) from non-existing man pages (Jonathan).
* Squash fix for sp_SP to following commit (Jonathan).
* Remove :manpage: also from fxyzzy(3) (non-existing man page).
* Add CSS for man page.
Link to v2:
https://lore.kernel.org/linux-doc/[email protected]/
Link to v1:
https://lore.kernel.org/linux-doc/[email protected]/
Petr Vorel (3):
Documentation: Remove :manpage: from non-existing man pages
Documentation: Link man pages to https://man7.org/
Documentation: CSS: Improve man page font
Documentation/conf.py | 3 +++ Documentation/process/adding-syscalls.rst | 16 ++++++++-------- Documentation/sphinx-static/custom.css | 8 +++++++- .../it_IT/process/adding-syscalls.rst | 16 ++++++++-------- .../sp_SP/process/adding-syscalls.rst | 16 ++++++++-------- 5 files changed, 34 insertions(+), 25 deletions(-)
Signature · 1 line
2.51.0
PATCH v3 1/3 Documentation: Remove :manpage: from non-existing man pages
Removing :manpage: from non-existing man pages (xyzzy(2), xyzzyat(2), fxyzzy(3) in adding-syscalls.rst, including translations) prevent adding link to nonexisting man pages when using manpages_url in next commit.
While at it, add also missing '(2)' in sp_SP translation.
---
Changes v2->v3:
* Remove ... (italic) from non-existing man pages (Jonathan).
* Squash fix for sp_SP to this commit (Jonathan).
* Remove :manpage: also from fxyzzy(3) (non-existing man page).
Documentation/process/adding-syscalls.rst | 16 ++++++++-------- .../it_IT/process/adding-syscalls.rst | 16 ++++++++-------- .../sp_SP/process/adding-syscalls.rst | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-)
Documentation/process/adding-syscalls.rst +8 -8
@@ -111,7 +111,7 @@ should use a file descriptor as the handle for that object -- don't invent a new type of userspace object handle when the kernel already has mechanisms and well-defined semantics for using file descriptors. -If your new :manpage:`xyzzy(2)` system call does return a new file descriptor, +If your new xyzzy(2) system call does return a new file descriptor, then the flags argument should include a value that is equivalent to setting ``O_CLOEXEC`` on the new FD. This makes it possible for userspace to close the timing window between ``xyzzy()`` and calling
@@ -127,18 +127,18 @@ descriptor. Making a file descriptor ready for reading or writing is the normal way for the kernel to indicate to userspace that an event has occurred on the corresponding kernel object. -If your new :manpage:`xyzzy(2)` system call involves a filename argument:: +If your new xyzzy(2) system call involves a filename argument:: int sys_xyzzy(const char __user *path, ..., unsigned int flags); -you should also consider whether an :manpage:`xyzzyat(2)` version is more appropriate:: +you should also consider whether an xyzzyat(2) version is more appropriate:: int sys_xyzzyat(int dfd, const char __user *path, ..., unsigned int flags); This allows more flexibility for how userspace specifies the file in question; in particular it allows userspace to request the functionality for an already-opened file descriptor using the ``AT_EMPTY_PATH`` flag, effectively -giving an :manpage:`fxyzzy(3)` operation for free:: +giving an fxyzzy(3) operation for free:: - xyzzyat(AT_FDCWD, path, ..., 0) is equivalent to xyzzy(path,...) - xyzzyat(fd, "", ..., AT_EMPTY_PATH) is equivalent to fxyzzy(fd, ...)
@@ -147,11 +147,11 @@ giving an :manpage:`fxyzzy(3)` operation for free:: :manpage:`openat(2)` man page; for an example of AT_EMPTY_PATH, see the :manpage:`fstatat(2)` man page.) -If your new :manpage:`xyzzy(2)` system call involves a parameter describing an +If your new xyzzy(2) system call involves a parameter describing an offset within a file, make its type ``loff_t`` so that 64-bit offsets can be supported even on 32-bit architectures. -If your new :manpage:`xyzzy(2)` system call involves privileged functionality, +If your new xyzzy(2) system call involves privileged functionality, it needs to be governed by the appropriate Linux capability bit (checked with a call to ``capable()``), as described in the :manpage:`capabilities(7)` man page. Choose an existing capability bit that governs related functionality,
@@ -160,7 +160,7 @@ under the same bit, as this goes against capabilities' purpose of splitting the power of root. In particular, avoid adding new uses of the already overly-general ``CAP_SYS_ADMIN`` capability. -If your new :manpage:`xyzzy(2)` system call manipulates a process other than +If your new xyzzy(2) system call manipulates a process other than the calling process, it should be restricted (using a call to ``ptrace_may_access()``) so that only a calling process with the same permissions as the target process, or with the necessary capabilities, can
@@ -196,7 +196,7 @@ be cc'ed to [email protected]. Generic System Call Implementation ---------------------------------- -The main entry point for your new :manpage:`xyzzy(2)` system call will be called +The main entry point for your new xyzzy(2) system call will be called ``sys_xyzzy()``, but you add this entry point with the appropriate ``SYSCALL_DEFINEn()`` macro rather than explicitly. The 'n' indicates the number of arguments to the system call, and the macro takes the system call name
Documentation/translations/it_IT/process/adding-syscalls.rst +8 -8
@@ -124,7 +124,7 @@ descrittore di file per accesso all'oggetto - non inventatevi nuovi tipi di accesso da spazio utente quando il kernel ha già dei meccanismi e una semantica ben definita per utilizzare i descrittori di file. -Se la vostra nuova chiamata di sistema :manpage:`xyzzy(2)` ritorna un nuovo +Se la vostra nuova chiamata di sistema xyzzy(2) ritorna un nuovo descrittore di file, allora l'argomento *flags* dovrebbe includere un valore equivalente a ``O_CLOEXEC`` per i nuovi descrittori. Questo rende possibile, nello spazio utente, la chiusura della finestra temporale fra le chiamate a
@@ -140,13 +140,13 @@ della famiglia di :manpage:`poll(2)`. Rendere un descrittore di file pronto per la lettura o la scrittura è il tipico modo del kernel per notificare lo spazio utente circa un evento associato all'oggetto del kernel. -Se la vostra nuova chiamata di sistema :manpage:`xyzzy(2)` ha un argomento +Se la vostra nuova chiamata di sistema xyzzy(2) ha un argomento che è il percorso ad un file:: int sys_xyzzy(const char __user *path, ..., unsigned int flags); dovreste anche considerare se non sia più appropriata una versione -:manpage:`xyzzyat(2)`:: +`xyzzyat(2)`:: int sys_xyzzyat(int dfd, const char __user *path, ..., unsigned int flags);
@@ -154,7 +154,7 @@ Questo permette più flessibilità su come lo spazio utente specificherà il fil in questione; in particolare, permette allo spazio utente di richiedere la funzionalità su un descrittore di file già aperto utilizzando il *flag* ``AT_EMPTY_PATH``, in pratica otterremmo gratuitamente l'operazione -:manpage:`fxyzzy(3)`:: +fxyzzy(3):: - xyzzyat(AT_FDCWD, path, ..., 0) is equivalent to xyzzy(path,...) - xyzzyat(fd, "", ..., AT_EMPTY_PATH) is equivalent to fxyzzy(fd, ...)
@@ -163,12 +163,12 @@ funzionalità su un descrittore di file già aperto utilizzando il *flag* man :manpage:`openat(2)`; per un esempio di AT_EMPTY_PATH, leggere la pagina man :manpage:`fstatat(2)`). -Se la vostra nuova chiamata di sistema :manpage:`xyzzy(2)` prevede un parametro +Se la vostra nuova chiamata di sistema xyzzy(2) prevede un parametro per descrivere uno scostamento all'interno di un file, usate ``loff_t`` come tipo cosicché scostamenti a 64-bit potranno essere supportati anche su architetture a 32-bit. -Se la vostra nuova chiamata di sistema :manpage:`xyzzy(2)` prevede l'uso di +Se la vostra nuova chiamata di sistema xyzzy(2) prevede l'uso di funzioni riservate, allora dev'essere gestita da un opportuno bit di privilegio (verificato con una chiamata a ``capable()``), come descritto nella pagina man :manpage:`capabilities(7)`. Scegliete un bit di privilegio già esistente per
@@ -178,7 +178,7 @@ principio di *capabilities* di separare i poteri di root. In particolare, evitate di aggiungere nuovi usi al fin-troppo-generico privilegio ``CAP_SYS_ADMIN``. -Se la vostra nuova chiamata di sistema :manpage:`xyzzy(2)` manipola altri +Se la vostra nuova chiamata di sistema xyzzy(2) manipola altri processi oltre a quello chiamato, allora dovrebbe essere limitata (usando la chiamata ``ptrace_may_access()``) di modo che solo un processo chiamante con gli stessi permessi del processo in oggetto, o con i necessari privilegi,
@@ -219,7 +219,7 @@ Implementazione di chiamate di sistema generiche ------------------------------------------------ Il principale punto d'accesso alla vostra nuova chiamata di sistema -:manpage:`xyzzy(2)` verrà chiamato ``sys_xyzzy()``; ma, piuttosto che in modo +`xyzzy(2)` verrà chiamato ``sys_xyzzy()``; ma, piuttosto che in modo esplicito, lo aggiungerete tramite la macro ``SYSCALL_DEFINEn``. La 'n' indica il numero di argomenti della chiamata di sistema; la macro ha come argomento il nome della chiamata di sistema, seguito dalle coppie (tipo, nome)
Documentation/translations/sp_SP/process/adding-syscalls.rst +8 -8
@@ -128,7 +128,7 @@ manipulador de ese objeto -- no invente un nuevo tipo de objeto manipulador userspace cuando el kernel ya tiene mecanismos y semánticas bien definidas para usar los descriptores de archivos. -Si su nueva llamada a sistema :manpage:`xyzzy(2)` retorna un nuevo +Si su nueva llamada a sistema xyzzy(2) retorna un nuevo descriptor de archivo, entonces el argumento flag debe incluir un valor que sea equivalente a definir ``O_CLOEXEC`` en el nuevo FD. Esto hace posible al userspace acortar la brecha de tiempo entre ``xyzzy()`` y la llamada a
@@ -145,12 +145,12 @@ archivo listo para leer o escribir es la forma normal para que el kernel indique al espacio de usuario que un evento ha ocurrido en el correspondiente objeto del kernel. -Si su nueva llamada de sistema :manpage:`xyzzy(2)` involucra algún nombre +Si su nueva llamada de sistema xyzzy(2) involucra algún nombre de archivo como argumento:: int sys_xyzzy(const char __user *path, ..., unsigned int flags); -debería considerar también si una versión :manpage:`xyzzyat(2)` es mas +debería considerar también si una versión xyzzyat(2) es mas apropiada:: int sys_xyzzyat(int dfd, const char __user *path, ..., unsigned int flags);
@@ -158,7 +158,7 @@ apropiada:: Esto permite más flexibilidad en como el userspace especifica el archivo en cuestión; en particular esto permite al userspace pedir la funcionalidad a un descriptor de archivo ya abierto usando el flag ``AT_EMPTY_PATH``, -efectivamente dando una operación :manpage:`fxyzzy(3)` gratis:: +efectivamente dando una operación fxyzzy(3) gratis:: - xyzzyat(AT_FDCWD, path, ..., 0) es equivalente a xyzzy(path, ...) - xyzzyat(fd, "", ..., AT_EMPTY_PATH) es equivalente a fxyzzy(fd, ...)
@@ -167,12 +167,12 @@ efectivamente dando una operación :manpage:`fxyzzy(3)` gratis:: revise el man page :manpage:`openat(2)`; para un ejemplo de AT_EMPTY_PATH, mire el man page :manpage:`fstatat(2)` manpage.) -Si su nueva llamada de sistema :manpage:`xyzzy(2)` involucra un parámetro +Si su nueva llamada de sistema xyzzy(2) involucra un parámetro describiendo un describiendo un movimiento dentro de un archivo, ponga de tipo ``loff_t`` para que movimientos de 64-bit puedan ser soportados incluso en arquitecturas de 32-bit. -Si su nueva llamada de sistema :manpage:`xyzzy` involucra una +Si su nueva llamada de sistema xyzzy(2) involucra una funcionalidad privilegiada, esta necesita ser gobernada por la capability bit linux apropiada (revisado con una llamada a ``capable()``), como se describe en el man page :manpage:`capabilities(7)`. Elija una parte de
@@ -182,7 +182,7 @@ misma sección, ya que va en contra de los propósitos de las capabilities de dividir el poder del usuario root. En particular, evite agregar nuevos usos de la capacidad ya demasiado general de la capabilities ``CAP_SYS_ADMIN``. -Si su nueva llamada de sistema :manpage:`xyzzy(2)` manipula un proceso que +Si su nueva llamada de sistema xyzzy(2) manipula un proceso que no es el proceso invocado, este debería ser restringido (usando una llamada a ``ptrace_may_access()``) de forma que el único proceso con los mismos permisos del proceso objetivo, o con las capacidades (capabilities)
@@ -221,7 +221,7 @@ kernel, debería siempre ser copiado a [email protected]. Implementation de Llamada de Sistema Generica --------------------------------------------- -La entrada principal a su nueva llamada de sistema :manpage:`xyzzy(2)` será +La entrada principal a su nueva llamada de sistema xyzzy(2) será llamada ``sys_xyzzy()``, pero incluya este punto de entrada con la macro ``SYSCALL_DEFINEn()`` apropiada en vez de explicitamente. El 'n' indica el numero de argumentos de la llamada de sistema, y la macro toma el nombre de
Signature · 1 line
2.51.0
PATCH v3 2/3 Documentation: Link man pages to https://man7.org/
In reply to Petr VorelConfigure manpages_url to link man pages to https://man7.org/.
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-manpages_url
---
The same as in v2.
Documentation/conf.py | 3 +++ 1 file changed, 3 insertions(+)
Documentation/conf.py +3 -0
@@ -51,6 +51,9 @@ else: dyn_exclude_patterns.append("devicetree/bindings/**.yaml") dyn_exclude_patterns.append("core-api/kho/bindings/**.yaml") +# Link to man pages +manpages_url = 'https://man7.org/linux/man-pages/man{section}/{page}.{section}.html' + # Properly handle directory patterns and LaTeX docs # -------------------------------------------------
Signature · 1 line
2.51.0
PATCH v3 3/3 Documentation: CSS: Improve man page font
In reply to Petr VorelDefine man page font as monospace and bold, i.e. the same as what is used for .code and <pre>.
---
New in v3.
Documentation/sphinx-static/custom.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Documentation/sphinx-static/custom.css +7 -1
@@ -20,7 +20,7 @@ div.sphinxsidebar { font-size: inherit; overflow-y: auto; } /* Tweak document margins and don't force width */ div.document { - margin: 20px 10px 0 10px; + margin: 20px 10px 0 10px; width: auto; }
@@ -151,3 +151,9 @@ div.sphinxsidebar a:hover { text-decoration: underline; text-underline-offset: 0.3em; } + +a.manpage { + font-style: normal; + font-weight: bold; + font-family: "Courier New", Courier, monospace; +}
Signature · 1 line
2.51.0
Re: [PATCH v3 3/3] Documentation: CSS: Improve man page font
Documentation/sphinx-static/custom.css div.sphinxsidebar a:hover { · line 159
Quoted 6 lines · Petr Vorel
Documentation/sphinx-static/custom.css +6
-0+ +a.manpage { + font-style: normal; + font-weight: bold; + font-family: "Courier New", Courier, monospace; +}
Shouldn't font-family be the same as Alabaster's default for consistency?:
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
Thanks.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Re: [PATCH v3 3/3] Documentation: CSS: Improve man page font
Quoted 11 lines · Petr Vorel
Documentation/sphinx-static/custom.css div.sphinxsidebar a:hover { · line 159
Quoted 6 lines
Documentation/sphinx-static/custom.css +6
-0+ +a.manpage { + font-style: normal; + font-weight: bold; + font-family: "Courier New", Courier, monospace; +}Shouldn't font-family be the same as Alabaster's default for consistency?:
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
Probably yes. FYI I took this from Documentation/sphinx-static/theme_overrides.css, maybe span.menuselection, code.kbd, code.kbd span should be fixed too.
Kind regards,
Petr
Quoted 1 line
Thanks.
Re: [PATCH v3 3/3] Documentation: CSS: Improve man page font
Quoted 10 lines · Petr Vorel
Quoted 9 lines · Petr Vorel
Documentation/sphinx-static/custom.css div.sphinxsidebar a:hover { · line 159
Quoted 6 lines
Documentation/sphinx-static/custom.css +6
-0+ +a.manpage { + font-style: normal; + font-weight: bold; + font-family: "Courier New", Courier, monospace; +}Shouldn't font-family be the same as Alabaster's default for consistency?:
Quoted 5 lines
Quoted 1 line
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
Probably yes. FYI I took this from
Documentation/sphinx-static/theme_overrides.css, maybe span.menuselection, code.kbd, code.kbd span should be fixed too.
OK, thanks!
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 17 lines · Petr Vorel
Changes
v1->v2:
* Remove...(italic) from non-existing man pages (Jonathan).
* Squash fix forsp_SPto following commit (Jonathan).
* Remove :manpage: also from fxyzzy(3) (non-existing man page).
* Add CSS for man page.Link to v2:
https://lore.kernel.org/linux-doc/[email protected]/Link to v1:
https://lore.kernel.org/linux-doc/[email protected]/Petr Vorel (3):
Documentation: Remove :manpage: from non-existing man pages
Documentation: Link man pages to https://man7.org/
Documentation: CSS: Improve man page font
Quoted 6 lines
Documentation/conf.py | 3 +++ Documentation/process/adding-syscalls.rst | 16 ++++++++-------- Documentation/sphinx-static/custom.css | 8 +++++++- .../it_IT/process/adding-syscalls.rst | 16 ++++++++-------- .../sp_SP/process/adding-syscalls.rst | 16 ++++++++-------- 5 files changed, 34 insertions(+), 25 deletions(-)
I have applied this set, thanks.
Even nicer, of course, would be to have automarkup recognize man-page references and add the links automatically so we wouldn't need the :manpage: noise. Something for another day, I guess...
Thanks,
jon
Hi Jon,
Quoted 26 lines · Jonathan Corbet
Quoted 17 lines · Petr Vorel
Changes
v1->v2:
* Remove...(italic) from non-existing man pages (Jonathan).
* Squash fix forsp_SPto following commit (Jonathan).
* Remove :manpage: also from fxyzzy(3) (non-existing man page).
* Add CSS for man page.Link to v2:
https://lore.kernel.org/linux-doc/[email protected]/Link to v1:
https://lore.kernel.org/linux-doc/[email protected]/Petr Vorel (3):
Documentation: Remove :manpage: from non-existing man pages
Documentation: Link man pages to https://man7.org/
Documentation: CSS: Improve man page fontQuoted 6 lines
Documentation/conf.py | 3 +++ Documentation/process/adding-syscalls.rst | 16 ++++++++-------- Documentation/sphinx-static/custom.css | 8 +++++++- .../it_IT/process/adding-syscalls.rst | 16 ++++++++-------- .../sp_SP/process/adding-syscalls.rst | 16 ++++++++-------- 5 files changed, 34 insertions(+), 25 deletions(-)
Quoted 5 lines
I have applied this set, thanks.
Even nicer, of course, would be to have automarkup recognize man-page references and add the links automatically so we wouldn't need the :manpage: noise. Something for another day, I guess...
We had some old scripts within the manual pages, which did something similar, and they had false positives. For example, 'exit(1)' is ambiguous, since a script can't know if it refers to calling exit(3) with value 1, or if it's a reference to the shell builtin.
I'd recommend being cautious about it. :)
Have a lovely night!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es>
Quoted 31 lines
Hi Jon,
Quoted 27 lines · Jonathan Corbet
Quoted 17 lines · Petr Vorel
Changes
v1->v2:
* Remove...(italic) from non-existing man pages (Jonathan).
* Squash fix forsp_SPto following commit (Jonathan).
* Remove :manpage: also from fxyzzy(3) (non-existing man page).
* Add CSS for man page.Link to v2:
https://lore.kernel.org/linux-doc/[email protected]/Link to v1:
https://lore.kernel.org/linux-doc/[email protected]/Petr Vorel (3):
Documentation: Remove :manpage: from non-existing man pages
Documentation: Link man pages to https://man7.org/
Documentation: CSS: Improve man page fontQuoted 6 lines
Documentation/conf.py | 3 +++ Documentation/process/adding-syscalls.rst | 16 ++++++++-------- Documentation/sphinx-static/custom.css | 8 +++++++- .../it_IT/process/adding-syscalls.rst | 16 ++++++++-------- .../sp_SP/process/adding-syscalls.rst | 16 ++++++++-------- 5 files changed, 34 insertions(+), 25 deletions(-)I have applied this set, thanks.
Quoted 8 lines
Quoted 3 lines
Even nicer, of course, would be to have automarkup recognize man-page references and add the links automatically so we wouldn't need the :manpage: noise. Something for another day, I guess...
We had some old scripts within the manual pages, which did something similar, and they had false positives. For example, 'exit(1)' is ambiguous, since a script can't know if it refers to calling exit(3) with value 1, or if it's a reference to the shell builtin.
Ah, so there are false positives.
Kind regards,
Petr
Quoted 5 lines
I'd recommend being cautious about it. :)
Have a lovely night!
Alex
Quoted 19 lines
Quoted 16 lines · Petr Vorel
Changes
v1->v2:
* Remove...(italic) from non-existing man pages (Jonathan).
* Squash fix forsp_SPto following commit (Jonathan).
* Remove :manpage: also from fxyzzy(3) (non-existing man page).
* Add CSS for man page.Link to v2:
https://lore.kernel.org/linux-doc/[email protected]/Link to v1:
https://lore.kernel.org/linux-doc/[email protected]/Petr Vorel (3):
Documentation: Remove :manpage: from non-existing man pages
Documentation: Link man pages to https://man7.org/
Documentation: CSS: Improve man page font
Quoted 8 lines
Quoted 6 lines
Documentation/conf.py | 3 +++ Documentation/process/adding-syscalls.rst | 16 ++++++++-------- Documentation/sphinx-static/custom.css | 8 +++++++- .../it_IT/process/adding-syscalls.rst | 16 ++++++++-------- .../sp_SP/process/adding-syscalls.rst | 16 ++++++++-------- 5 files changed, 34 insertions(+), 25 deletions(-)I have applied this set, thanks.
Thanks!
Quoted 3 lines
Even nicer, of course, would be to have automarkup recognize man-page references and add the links automatically so we wouldn't need the :manpage: noise. Something for another day, I guess...
Ah, you don't like :manpage: in the rst sources. I try to look into it later.
It looked to me safer than regexp, but hopefully any word following by \([1-8]\) should be a man page.
Advantage would be that other man pages yet declared would be matched [1], although some [2] would require to remove code formatting (``...``).
Kind regards,
Petr
[1] https://docs.kernel.org/admin-guide/LSM/Smack.html#file-system-interfaces
[2] https://docs.kernel.org/bpf/prog_cgroup_sysctl.html#context
Quoted 3 lines
Thanks,
jon