diff --git a/Makefile b/Makefile index 324d8a4..361debe 100644 --- a/Makefile +++ b/Makefile @@ -52,12 +52,16 @@ storage-agent-proto-headers: # Docs ############################################################################### +.PHONY: pandoc-gen-doc +pandoc-gen-doc: + pandoc --from man --to gfm+definition_lists --shift-heading-level-by 1 --output doc/references/manpage.md doc/ud3tn.1 + .PHONY: protoc-gen-doc protoc-gen-doc: protoc --doc_out=doc/references/protobuf --doc_opt=doc/references/protobuf/protoc-gen-doc-markdown.tmpl,index.md components/aap2/aap2.proto components/agents/storage/storage_agent.proto .PHONY: doc -doc: protoc-gen-doc +doc: pandoc-gen-doc protoc-gen-doc mkdocs build --site-dir result/ ############################################################################### diff --git a/doc/README.md b/doc/README.md index 1859a85..5c8568d 100644 --- a/doc/README.md +++ b/doc/README.md @@ -8,6 +8,7 @@ An HTML version of the μD3TN documentation is created via [MkDocs](https://www. - w/o nix + - Install [pandoc](https://pandoc.org/installing.html) - Install [protoc](https://grpc.io/docs/protoc-installation/) - Install [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) via your package manager, `go install` or another preferred method @@ -34,6 +35,13 @@ An HTML version of the μD3TN documentation is created via [MkDocs](https://www. ### Develop ```sh +# create markdown docs from manpage +pandoc \ + --from man \ + --to gfm+definition_lists \ + --shift-heading-level-by 1 \ + --output doc/references/manpage.md \ + doc/ud3tn.1 # Create markdown docs from protobuf protoc \ --doc_out=doc/references/protobuf \ diff --git a/doc/references/.gitignore b/doc/references/.gitignore new file mode 100644 index 0000000..39960b3 --- /dev/null +++ b/doc/references/.gitignore @@ -0,0 +1 @@ +manpage.md diff --git a/mkdocs.yaml b/mkdocs.yaml index e351b31..3785b8d 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -117,7 +117,7 @@ nav: - pyd3tn API Reference: 'references/pyd3tn.md' - Protobuf: 'references/protobuf/index.md' # - Configurations: - # - Manpages: + - Manpages: 'references/manpage.md' - Research Papers: 'references/papers.md' # - Projects: diff --git a/nix/packages.nix b/nix/packages.nix index c30dc19..d79559c 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -68,6 +68,7 @@ rec { nativeBuildInputs = with pkgs; [ doxygen + pandoc protobuf protoc-gen-doc ] ++ (with python3Packages; [ @@ -84,7 +85,12 @@ rec { --doc_opt=doc/references/protobuf/protoc-gen-doc-markdown.tmpl,index.md \ components/aap2/*.proto \ components/agents/storage/storage_agent.proto - + pandoc \ + --from man \ + --to gfm+definition_lists \ + --shift-heading-level-by=1 \ + --output doc/references/manpage.md \ + doc/ud3tn.1 mkdocs build --site-dir $out ''; }; diff --git a/nix/shell.nix b/nix/shell.nix index 043d2ed..53cd418 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -30,6 +30,7 @@ pkgs.mkShell rec { jansson llvmPackages.libcxxClang nixpkgs-fmt + pandoc protobuf protoc-gen-doc python3Packages.flake8