Skip to content

docs: convert man page sources to "curldown" format#1660

Closed
vszakats wants to merge 16 commits intolibssh2:masterfrom
vszakats:docsmd
Closed

docs: convert man page sources to "curldown" format#1660
vszakats wants to merge 16 commits intolibssh2:masterfrom
vszakats:docsmd

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Sep 14, 2025

To render in Git webviews as-is, to make it easier to edit, verify,
and to sync up with curl.

  • add options to not build the .3 man pages:
    • autotools: --disable-docs
    • cmake: LIBSSH2_BUILD_DOCS=OFF
  • building .3 man pages requires Perl after this patch.
  • drop mansyntax and the shell / grep / GNU man tool requirements with it.
  • scripts and most logic were copied from curl.
  • add cd2nroff from curl, with edits to relax curl-specific checks.
  • used nroff2cd (from curl) to convert from .3 to .md. Then
    manually fixed copyrights, inline function references and a couple
    of other things.

Credits-to: Daniel Stenberg

Ref: curl/curl@eefcc1b
Ref: curl/curl#12730
Ref: libssh2/www#25 (comment)


This will need updates on the libssh2/www side. But, it also allows
to just drop the documentation from the website and use this repo
directly to read man pages in the browser. They render well by default: https://github.com/vszakats/libssh2/blob/8727af0c9666c4f66db6087deb1657dbacf63d0b/docs/libssh2_channel_read_ex.md

@vszakats vszakats marked this pull request as draft September 14, 2025 19:57
@vszakats vszakats force-pushed the docsmd branch 2 times, most recently from 84b5bfc to dba656a Compare September 14, 2025 23:31
@vszakats vszakats marked this pull request as ready for review September 14, 2025 23:46
@vszakats vszakats changed the title docs: convert docs to curldown format docs: convert man page sources to curldown format Sep 15, 2025
@vszakats vszakats marked this pull request as draft September 15, 2025 08:19
@vszakats vszakats changed the title docs: convert man page sources to curldown format docs: convert man page sources to "curldown" format Sep 15, 2025
@vszakats vszakats marked this pull request as ready for review September 15, 2025 11:21
@vszakats vszakats closed this in b889b39 Oct 9, 2025
@vszakats vszakats deleted the docsmd branch October 9, 2025 02:06
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 9, 2025
libssh2/libssh2@b889b39
libssh2/libssh2#1660

Fixing:
```
+ read -r d
+ lipo -create -output curl-8.17.0-DEV_20251009-universal-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-x86_64-macos/dep/libssh2/docs/cd2nroff.txt
fatal error: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt
+ rm -r -f /Users/runner/work/curl-for-win/curl-for-win/.cw-gpg
Error: Process completed with exit code 1.
```
https://github.com/curl/curl-for-win/actions/runs/18388441115/job/52392670105#step:3:10158
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 9, 2025
Upstream replaced `.3` source files with `.md` "curldown" ones.
Simplify the copying process and avoid the new script that was
picked up by `lido`, causing the job to fail.

Fixing:
```
+ read -r d
+ lipo -create -output curl-8.17.0-DEV_20251009-universal-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-x86_64-macos/dep/libssh2/docs/cd2nroff.txt
fatal error: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt
+ rm -r -f /Users/runner/work/curl-for-win/curl-for-win/.cw-gpg
Error: Process completed with exit code 1.
```
Ref: https://github.com/curl/curl-for-win/actions/runs/18388441115/job/52392670105#step:3:10158

Ref: libssh2/libssh2@b889b39
Ref: libssh2/libssh2#1660
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 9, 2025
Upstream replaced `.3` source files with `.md` "curldown" ones.
Simplify the copying process and avoid the new script that was
picked up by `lido`, causing the job to fail.

Fixing:
```
+ read -r d
+ lipo -create -output curl-8.17.0-DEV_20251009-universal-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-x86_64-macos/dep/libssh2/docs/cd2nroff.txt
fatal error: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt
+ rm -r -f /Users/runner/work/curl-for-win/curl-for-win/.cw-gpg
Error: Process completed with exit code 1.
```
Ref: https://github.com/curl/curl-for-win/actions/runs/18388441115/job/52392670105#step:3:10158

Ref: libssh2/libssh2@b889b39
Ref: libssh2/libssh2#1660
vszakats added a commit to curl/curl-for-win that referenced this pull request Oct 10, 2025
Upstream replaced `.3` source files with `.md` "curldown" ones.
Simplify the copying process and avoid the new script that was
picked up by `lido`, causing the job to fail.

Fixing:
```
+ read -r d
+ lipo -create -output curl-8.17.0-DEV_20251009-universal-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt ./curl-8.17.0-DEV_20251009-x86_64-macos/dep/libssh2/docs/cd2nroff.txt
fatal error: /Applications/Xcode_16.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: ./curl-8.17.0-DEV_20251009-aarch64-macos/dep/libssh2/docs/cd2nroff.txt
+ rm -r -f /Users/runner/work/curl-for-win/curl-for-win/.cw-gpg
Error: Process completed with exit code 1.
```
Ref: https://github.com/curl/curl-for-win/actions/runs/18388441115/job/52392670105#step:3:10158

Ref: libssh2/libssh2@b889b39
Ref: libssh2/libssh2#1660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant