introducing "curldown" for libcurl man page format#12730
introducing "curldown" for libcurl man page format#12730
Conversation
e67a9d8 to
fe96ca5
Compare
fe96ca5 to
0139d7f
Compare
|
The |
0139d7f to
272b028
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
57f7358 to
ddbf3f7
Compare
ddbf3f7 to
2380072
Compare
This comment was marked as resolved.
This comment was marked as resolved.
2380072 to
dd0a3d5
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
b8c1be7 to
bd659c5
Compare
|
An interesting side-effect of switching to |
|
Adding a CMake option to disable building docs: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70ca457a9..18d8d085b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -306,6 +306,7 @@ endif()
find_package(Perl)
+option(BUILD_DOCS "to build manual pages" ON)
option(ENABLE_MANUAL "to provide the built-in manual" OFF)
if(ENABLE_MANUAL AND PERL_FOUND)
diff --git a/docs/libcurl/CMakeLists.txt b/docs/libcurl/CMakeLists.txt
index fc1283a53..c719c9764 100644
--- a/docs/libcurl/CMakeLists.txt
+++ b/docs/libcurl/CMakeLists.txt
@@ -54,11 +54,13 @@ add_custom_command(OUTPUT libcurl-symbols.md
VERBATIM
)
-add_manual_pages(man_MANS)
-add_custom_target(man ALL DEPENDS ${man_MANS})
-if(NOT CURL_DISABLE_INSTALL)
- install(FILES "$<LIST:TRANSFORM,${man_MANS},PREPEND,${CMAKE_CURRENT_BINARY_DIR}/>"
- DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
-endif()
+if(BUILD_DOCS)
+ add_manual_pages(man_MANS)
+ add_custom_target(man ALL DEPENDS ${man_MANS})
+ if(NOT CURL_DISABLE_INSTALL)
+ install(FILES "$<LIST:TRANSFORM,${man_MANS},PREPEND,${CMAKE_CURRENT_BINARY_DIR}/>"
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
+ endif()
-add_subdirectory(opts)
+ add_subdirectory(opts)
+endif()(Edited to be enabled by default.) |
|
They are built with autotools by default and there is no option to switch that off... |
|
On my machine, building all libcurl ~500 man pages takes 800 milliseconds. It is a pretty quick operation, even if my machine might be above average CPU and disk speed wise. |
|
I takes almost as long as the build itself here, but I'm on fairly old gear. I'd appreciate an option to turn this off, as this will increase greatly the time for each build. When doing them by the hundreds, it adds up. (Even building curl.1/hugehelp takes a fair amount, but I can tweak that locally.) For some reason autotools never built man pages with the curl-for-win script, I don't know why, with Edit: with this PR applied, autotools quits with: |
|
Fair enough! |
|
Re: autotools, it did have this working before this patch, but was unnoticably fast (being just a handful of But, for now autotools builds quit with this error (with this PR applied), so I couldn't actually test it: |
We use autotools in numerous CI builds, including windows (on appveyor) and none of them fail like that... I'm not saying there is no problem left, but I might not consider that a blocker for merging this. |
|
This is the biggest PR I/we have done in a long time. I completely expect that there will be some issues popping up once we merge this, but I don't think they are worse than we can just fix them. I believe this is a good PR. |
|
No worries, re-run it in a clean sandbox, and that resolved it. |
|
This But this works fine: And so does my good old StrawBerry Perl (v5.18.4 from 2014). Edit: Cygwin's Perl doesn't work at all. Hence using StrawBerry Perl. |
|
It built in several Windows CI jobs, but I'm sure we can improve it. |
Since all those CI jobs checks out with |
No, I can't see anything that sets
Whenever I try to guess how something works with text files on Windows, I seem to guess wrong. So I don't know. |
|
I bet you can fix that by changing/setting some locale environment variable(s)... |
- cmake: enable `BUILD_DOCS` by default (this controls converting and installing `.3` files from `.md` sources) - cmake: speed up generating `.3` files by using a single command per directory, instead of a single command per file. This reduces external commands by about a thousand. (There remains some CMake logic kicking in resulting in 500 -one per file- external `-E touch_nocreate` calls.) - cd2nroff: add ability to process multiple input files. - cd2nroff: add `-k` option to use the source filename to form the output filename. (instead of the default in-file `Title:` line.) Follow-up to 3f08d80 Follow-up to ea0b575 #12753 Follow-up to eefcc1b #12730 Closes #12762
|
That I cannot explain because to me it looks like the generate the date strings identically! |
It was accidentally added in curl#12730 Co-authored-by: Lukáš Zaoral <lzaoral@redhat.com> Signed-off-by: Jan Macku <jamacku@redhat.com> Follow-up to eefcc1b
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) Closes #1660


overview
curldown is this new file format for libcurl man pages. It is markdown inspired with differences:
their man page section is specified)
tools:
This setup generates .3 versions of all the curldown versions at build time.
CI
Since the documentation is now technically markdown in the eyes of many
things, the CI runs many more tests and checks on this documentation,
including proselint, link checkers and tests that make sure we capitalize the
first letter after a period...
tasks
.XXinstructions in nroff files are handled by nroff2cd.mdsourcesdocs/CURLDOWN.mddocuments the format and involved tools.mdfile extensionsThe tests that rely on the man pages to be present will be disabled for the CI jobs that use cmake on Appveyor for now.