Coder Social home page Coder Social logo

peterth / hdoc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hdoc/hdoc

4.0 2.0 1.0 11.45 MB

The modern documentation tool for C++.

Home Page: https://hdoc.io/

License: GNU Affero General Public License v3.0

Shell 0.30% JavaScript 0.41% C++ 50.26% Nix 0.14% Meson 0.47% CSS 48.42%

hdoc's Introduction

๐Ÿฅฌdoc: a documentation tool for C++

This is a fork of hdoc, with additional functionality (and without online functionality).

It is designed specifically to add the features required to generate documentation for Celerity.
We are happy to integrate useful PRs, but we don't currently have the bandwidth to accomodate feature requests.

New features and changes compared to hdoc

  • Support documenting explicit template specializations of records
  • Support markdown syntax in doc comments
  • Document aliases (i.e. usings), both at top level namespaces and in records
  • Correctly resolve file locations for symbols defined in macros (and therefore include them in the docs)
  • Allow defining symbols as part of a "detail" set based on a list of namespace (sub-)strings; this set can be styled differently
  • Allow ignoring symbols on namespace basis (in addition to file path)
  • Include operators in documentation and format them properly
  • Various improvements to presentation, especially in the presence of complex member function signatures
  • Builds with Clang/LLVM 17

Broken/unmaintained features compared to hdoc

  • Everything related to the hosting/online functionality of hdoc is unmaintained
  • JSON serialization of the symbol database is unsupported
  • Search (we use a search system provided by algolia)

Original hdoc documentation follows

Usage documentation is hosted at hdoc.io/docs.

An important notice about this repository

The contents of this repository are a subset of a private repository where hdoc's development takes place.

Overview and features

  • Autogenerated API documentation. hdoc generated API documentation for every function, record, enum, and namespace in your codebase.
  • Integrated Markdown pages. hdoc converts your Markdown pages into a website and puts it next to your API docs. All of your documentation is in one place.
  • Instant codebase search. Instant search-as-you-type lookup of symbols throughout your entire codebase.
  • Easy CI integration. Your documentation is never out of date if you build it with your code. All you need to do is add hdoc to your build job.
  • Advanced C++ parser. hdoc understands the newest C++ features with its advanced LLVM/Clang-based parser.
  • Clean, fast output. hdoc outputs fully static HTML with no required Javascript, ensuring your users never have to wait.

Quick start

Linux

hdoc depends on LLVM/Clang and OpenSSL, and all other dependencies are vendored in subprojects/. hdoc also comes with a Nix Flake which sets up a development environment for you with all of the needed dependencies, and should work on all Linux distributions. Follow the instructions below to build hdoc.

# Build hdoc
meson build             # Configure the build directory
ninja -C build          # Compile hdoc binaries and tests
./build/hdoc --verbose  # Run hdoc over itself, saving the HTML documentation to ./hdoc-output/

More instructions for using hdoc can be found at hdoc.io/docs.

Windows (Unofficial Support)

Windows support for hdoc is unofficial and was contributed by @yqs112358. Windows is unofficially supported as the hdoc team does not use it for development. hdoc is not tested on Windows and no guarantee is made for its functionality there. However, the following instructions for compiling hdoc on Windows.

MSYS2 and MinGW-w64-x86_64-gcc must be installed in order to compile hdoc on Windows. Once the prerequisites have been installed, follow the instructions below to build hdoc:

# Install dependent packages for MinGW
pacman -S groff
pacman -S unzip
pacman -S mingw-w64-x86_64-meson
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-clang
pacman -S mingw-w64-x86_64-clang-analyzer
pacman -S mingw-w64-x86_64-clang-tools-extra

# Set PATH
export PATH=/mingw64/bin:/mingw64/lib:$PATH		# You can also add this line into ~/.bashrc

# Build hdoc
meson build             # Configure the build directory
ninja -C build          # Compile hdoc binaries and tests
./build/hdoc --verbose  # Run hdoc over itself, saving the HTML documentation to ./hdoc-output/

Reportedly, hdoc-online.exe does not currently work on Windows due to a linking problem. However, hdoc.exe should work.

Running tests

hdoc has a suite of unit and integration tests, which can be run using the instructions below.

# Assumes you've already built hdoc
cd build

# Running indexing tests, unit tests, and JSON serialization/deserialization tests
./hdoc-tests

# Running integration tests
cd ../tests/integration_tests
./clone-corpus-repos.sh        # Pull testing repos from GitHub
./test.sh                      # Run hdoc over testing repos

Repository structure

hdoc
โ”œโ”€โ”€ assets       # Static HTML/CSS/Favicons used in the generated HTML docs
โ”œโ”€โ”€ schemas      # JSON schema for hdoc's JSON payload output
โ”œโ”€โ”€ site         # Source code for hdoc.io and hdoc's documentation
โ”œโ”€โ”€ src          # C++ source code
โ”‚ย ย  โ”œโ”€โ”€ frontend   # Parses configuration file and CLI arguments
โ”‚ย ย  โ”œโ”€โ”€ indexer    # Parses a codebase and extracts documentation from it into an index
โ”‚ย ย  โ”œโ”€โ”€ serde      # Serialization/Deserialization of hdoc's index into HTML and other formats
โ”‚ย ย  โ”œโ”€โ”€ support    # Ancillary code used to parallelize indexing
โ”‚ย ย  โ””โ”€โ”€ types      # Types used by hdoc
โ”œโ”€โ”€ subprojects  # Vendored dependencies
โ””โ”€โ”€ tests        # Testing code
 ย ย  โ”œโ”€โ”€ index-tests  # Unit tests of hdoc's indexing functionality
 ย ย  โ”œโ”€โ”€ integration-tests # Integration testing scripts
 ย ย  โ”œโ”€โ”€ json-tests   # Tests for JSON serialization and deserialization
 ย ย  โ””โ”€โ”€ unit-tests   # Unit tests for a small portion of hdoc's codebase

Attribution

hdoc relies on several open source software projects. We thank all of the contributors to these projects for their work. These are listed below in alphabetical order:

More information, including licenses, can be found at hdoc.io/oss.

License

hdoc is available under the AGPLv3 license, or a custom commercial license. For more information about commercial licensing, reach out to [email protected].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.