MCPcopy Index your code
hub / github.com/daynin/fundoc

github.com/daynin/fundoc @v0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.0 ↗ · + Follow
199 symbols 510 edges 17 files 2 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Language agnostic documentation generator. Written in Rust 🦀

Tests Status License GitHub Issues Crates.io

Fundoc - the right way to generate documentation. Business features in your project can be implemented in different files and even in different technologies. Fundoc can merge all descriptions of those features and put them in appropriate files.

Fundoc's main goals:

  • Allow you to keep all your documentation along with your code. Separating documentation and code makes it harder to support projects.
  • Use the same versioning tools for your documentation and code. All versions of your documentation should match versions of source code otherwise we can't trust documentation.
  • Documentation generators should allow you to write your documentation from different file types like source code files (Rust, C++, TypeScript, Java, JavaScript, Ruby, Python, etc), specification files (Alloy, TLA+, etc), stylesheet files (CSS, SCSS, QT Stylesheets, etc), configs (JSON, TOML, YAML, etc).

Why you should use it

If you want to keep your documentation synchronized with your code and to be able to describe different parts of a business feature in places where it was implemented you can write documentation in your source files or near them.

One source file, one documentation file

You can describe business logic in one particular source file and generate documentation from it. It can be useful for describing config files, features implemented in one file or component, etc. Here you can find an example of using Fundoc to describe ESLint/Prettier configs.

<img src="https://github.com/daynin/fundoc/raw/v0.5.0/images/example-1.png" />

Multiple source files, one documentation file

You can write your documentation in multiple source files using different programming languages and still have an ability to get all documentation in one file (one file per article).

<img src="https://github.com/daynin/fundoc/raw/v0.5.0/images/example-2.png" />

Also you can use .md files combining documentation from source files and from .fdoc.md files. In that case the name of an article will be got from a name of a file.

It can help you keep your documentation up to date and change only that part of the documentation that is connected to the code you're changing. And your team members can easily find the source of a documentation part using generated links on source files.

By the way, documentation here is generated by Fundoc itself, so you can check out how it works.

Installation

You can install Fundoc by executing this shell script:

curl -LSfs https://japaric.github.io/trust/install.sh | \
    sh -s -- --git daynin/fundoc

If you're rust developer and you have had rust compiler installed, you can install Fundoc from crates.io:

cargo install fundoc

Or manually download it from the releases page.

How to use

You can create a config file by executing fundoc --init command and answering few questions:

<img src="https://github.com/daynin/fundoc/raw/v0.5.0/images/fundoc-init.png" />

All Fundoc's parameters are described here

To generate documentation run fundoc:

<img src="https://github.com/daynin/fundoc/raw/v0.5.0/images/fundoc-work.png" />

Fundoc supports mdBook, so if you want to generate documentation in mdBook format you can do it by setting mdBook: true in your config file. It can be useful if you want to use GitHub Pages with full-text search support in your project.

<img src="https://github.com/daynin/fundoc/raw/v0.5.0/images/full-text-search.gif" />

Plugins

You can write your own plugins to enhance Fundoc's abilities. To do so, you can simply write a Lua plugin like this:

function transform(text)
  importMermaid = '<script type="module"> import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10.0.2/+esm"; mermaid.initialize({}); </script>'

  result = '<pre class="mermaid">' .. text .. '</pre>' .. importMermaid
e

Read more about plugins!

Companies/projects who use Fundoc

Know of others? Create a PR to let me know!

GitHub Action

You can use Fundoc's GitHub Action to automate documentation generation.

Roadmap

  • [x] Merging documentation from different files.
  • [x] Different file types support.
  • [x] Creating links to the source files from the documentation.
  • [x] Generating mdBook with an ability to search through documentation.
  • [x] Multi-repositories support (collecting all documentation fragments from different repos).
  • [x] Add Mermaid support
  • [x] Add a plugin-system
  • [ ] Add file system API for the plugin system
  • [ ] Add FFI for the plugin system
  • [ ] Zettelkasten method support (maybe)

Core symbols most depended-on inside this repo

r
called by 39
docs/highlight.js
add
called by 29
docs/highlight.js
n
called by 22
docs/highlight.js
get_test_config
called by 19
src/parser.rs
exec
called by 19
docs/highlight.js
parse_file
called by 16
src/parser.rs
as_str
called by 13
src/parser.rs
t
called by 12
docs/highlight.js

Shape

Function 115
Method 61
Class 21
Enum 2

Languages

TypeScript61%
Rust39%

Modules by API surface

docs/highlight.js71 symbols
src/parser.rs47 symbols
docs/searcher.js19 symbols
docs/book.js18 symbols
src/generator.rs8 symbols
docs/clipboard.min.js6 symbols
src/plugins.rs5 symbols
docs/mark.min.js5 symbols
src/lua_runtime.rs4 symbols
src/git.rs4 symbols
src/config.rs3 symbols
docs/elasticlunr.min.js3 symbols

For agents

$ claude mcp add fundoc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact