Git Product home page Git Product logo

doctave's Introduction

CI Status Docs

Doctave

Doctave is an opinionated documentation site generator that converts your Markdown files into a beautiful documentation site with minimal effort.

Doctave is not a generic static site generator - it is only meant for generating documentation sites from Markdown. This allows the tool to be much simpler than other solutions, with fewer configuration steps.

This open source tool is built and maintained by Doctave.com.

Features

Doctave comes with a number of documentation-specific features out of the box. No plugins needed.

  • Mermaid.js diagrams
  • Offline full-text search
  • Local live-reloading server
  • Broken links checking
  • Typesetting for mathematical formulas
  • Responsive design
  • Dark mode
  • GitHub flavored markdown
  • Minimal configuration
  • Fast build times (Doctave is built with Rust)

Hosting

Doctave-generated sites can be hosted on any static site hosting provider, such as GitHub Pages. You can also use Doctave.com, which is a specialized Doctave host, for free for public docs.

Screenshots

You can customize the color scheme and logo to match your own style. Below are two examples: one with Doctave's own color scheme, and another customized color scheme.

Light Dark
Exmple 1 Example 2
Exmple 2 Example 2

Installation

There are a few installation options for Doctave. If you would like another installation option, please open an issue for it.

Precompiled binaries

Doctave provides precompiled binaries for Mac, Linux, and Windows, which you can download from the latest release page.

Homebrew

Doctave maintains its own homebrew tap, and you can install Doctave via the following command:

$ brew install doctave/doctave/doctave

This will take a few minutes as Doctave is compiled from scratch for your machine.

Cargo (Rust package manager)

You can also use the Rust package manager, Cargo, to install Doctave. Currently Doctave is not listed on crates.io, but you can install it directly from GitHub:

$ cargo install --git https://github.com/Doctave/doctave --tag 0.4.2

Getting started

Once you have Doctave installed, you can run the init command to create an initial docs site:

$ doctave init

Then, run the serve command to preview your site locally.

$ doctave serve

Doctave | Serve
Starting development server...

Server running on http://0.0.0.0:4001/

doctave's People

Contributors

begleynk avatar datdenkikniet avatar oeb25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doctave's Issues

Issues tab displays problems with node_modules READMEs

Problem

The desktop app is flagging almost 200 issues with our project. Most if not all are isseus with READMEs in the node_modules directory. Obviously, we don't own these and they are not included in the final build of the site.

Currently, the issues list is basically useless given the quantity of noise.

Example

Screenshot 2023-09-12 at 15 57 36

Proposed solution

Two ideas:

  1. Add an ignores key to doctave.yaml that allows you to specify directories to ignore. This should come with node_modules already added
  2. Ignore node_modules by default and don't allow any customisation

Publish the package to `crates.io`

I noticed that this package is not published on crates.io. I think it'd be good to add this, to simplify installation and ensure that there will be a nice backup.

Is this something that could be done?

Windows .exe not opening

I downloaded the latest release & unzipped the file, but I can't open the .exe file.
Win 10 64bit

Error after editing the files newly added

I am trying to test Doctave on Windows. Have initiated the website, however after editing some of the files I am getting the following error. Can you tell me how can I resolve this error.

Screenshot 2022-03-11 154008

[FEATURE REQUEST] .gitignore but for doctave

I recently found your Project and decided to use it for my Obsidian notes workflow. So I can generate a static version to host.
But I found the need to exclude specific files or folders.

Doctave sadly doesn't allow ignoring specific folders, is it possible in the future to make a .doctaveignore?

Build process crashes when - path: docs/README.md is specified

The build process crashes and panics when specifying the README.md file as a path.

Example:

// >> doctave.yaml
---
title: "Repo"
navigation:
  - path: docs/README.md
$ RUST_BACKTRACE=1 doctave build                                                                                                                                                                                                

at 14:37:03
Doctave | Build
Building site into /home/msc/Code/go/src/oceanbolt.com/spire-vessels/site

thread 'main' panicked at 'No matching link found', src/navigation.rs:47:26
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/option.rs:1578:5
   3: doctave::navigation::Navigation::customize
   4: doctave::navigation::Navigation::build_for
   5: <doctave::site::DiskBackedSite as doctave::site::Site>::build
   6: doctave::build::BuildCommand::run
   7: doctave::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

It is not a major issue, but it caused a bit of debugging for me trying to get the custom navigation to work. It was unclear that it was the README.md inclusion that caused the error. Suggesting to either ignore the file if specified, or provide a more helpful error.

not found pages

provides a default 404 page and enable custom not found pages.

e.g.

title: my project
not_found_page: docs/404.md

Using README.md files results in confusing sidebar

Hi Niklas,

I reached out a few months ago. I have some time so giving doctave a go.

Our repo is structured so that docs live next to the code, e.g.:

app/
  - README.md
  - index.tsx
  - components/
      - README.md
      - NavBar.tsx

It seems that doctave uses the file name "README" when populating the navbar. Is docs in README a use-case for doctave? If so, it might be helpful to use either the title of the README or use the directory name instead of "README"

image

Expand supported languages in syntax highlighting

Follow up from:

The creator of the issue wanted a way to override the prism.js version in order to get support for his language choice. While I don't feel Doctave should allow this by default (it goes against the idea of "batteries included"), the problem of not supporting their languages is a real problem that should be solved.

The issue is that prism.js grammars are non-trivial in size. Including all languages increases the bundle size, and given that most people will only require 1 or 2 languages, this seems wasteful.

I think there are 2 options to look into here:

Use the autoloader feature of Prism to load at runtime only the languages that are on the page.
This does not decrease the final bundle size, but at least we don't have to transfer all grammars on every request.

Detect which languages are used on each page and dynamically include into the final bundle only the used languages.
Seems complicated, but this would have the added benefit of reducing the deployed bundle size too.

Tags (metadata taxonomy)

Having a default tag taxonomy with tags displayed on each page and pointing to the corresponding tag index.

Extensive explanation of the tag support idea: intuit/Ignite#126 (tags display on pages, tags index, tags list, etc.)

Examples

Examples in other staticgen:

Screenshot on retype:

Tags button embedded on a page: image

A tag index (https://retype.com/tags/config/): image

The index of all tags (https://retype.com/tags/): image

Examples on my Hexo blog:

Tags on an article: image

A tag index (https://blog.raw.pm/tags/eop/): image

The list of all tags (https://blog.raw.pm/tags/): image

A tag cloud widget: image

Doctave Release - Not working navigation links

When I release a new build landing page and all index.html work just fine. But all other HTML (Markdown) files are not showing.

For example: I have a folder called Rezepte. So the navigation link is /Rezepte, which works, because a README.md file is converted to an index.html.

However the Doctave.md file within that folder is not reachable via the navigation. The link is /Rezepte/Doctave but this is not a file. /Rezepte/Doctave.html on the other hand works as expected.

CleanShot 2023-01-03 at 16 47 04

Is this a bug in doctave or in my setup? I use valet locally to run dev sites.

New configuration option: Display the first headline in navigation menu instead of the Filename?

First, let me start by saying thank you for this great project. It was very easy to get started. I had my first demo website generated within minutes!

However, there is one think i run into:

Would it be useful to add a configuration option to use the first markdown headline in a file instead of the filename?
image

I know that i can achieve the desired outcome by adding

---
title: My.Namespace.Test
---

on top of this each file.

My use case is the document generation for a few libraries. Unfortunately, i can not change the README.md files because there are used in different places. That's why i would prefer a configuration toggle.

how to install for windows??

this looks like a great tool, but I really can't figure out how to get it install it!

Ive downloaded the .exe file. ran it, ran it via my bash cli, ran it via powershell, downloaded rust and cargo, tried to install that way but then i got an error saying i needed some visual studio tools...

There must be a simple step that I dont know about here?

Allow overriding of existing JS dependencies like prism

Doctave comes prepackaged with a version of prism that has a subset of languages for highlighting in code blocks. If we want to change the version of prism used, all we'd have to do is edit the prism.js file. (FWIW, I was interested in YAML and BASH highlighting). I'd expect if I:

  • Add the custom prism.js file I wanted in docs/_include/assets
  • Running doctave serve should reflect the change
  • Running doctave build --release should reflect the change: the file should be copied to site/assets/prism.js

But neither of the above occurs.

This may be as simple as allowing any file in docs/_include/assets to be copied over at the latest possible step.

i.e., switching these two lines:

self.build_includes()?;
self.build_assets()?;

Use updated mermaid.js

Doctave is currently using mermaid.js with version 8.8.0. The latest release of mermaid.js is 8.13.3.
I am currently observing differences in mermaid live editor and the doctave rendered pages because of the version change.

In general, is it possible to keep these javascript libraries updated via a build script ?

Make documentation root configurable

I'd really like for the documentation root to be configurable.

If that's a non-starter, I'd really like for the error messages produced when attempting to find navigation to be refined.

Currently, using this doctave.yaml

---
title: "My Project"

navigation:
  - path: subdir1/
    children: "*"

produces a rather confusing error message (I included the backtrace for good measure).

Doctave | Serve
Starting development server...

thread 'main' panicked at 'No matching link found', src/navigation.rs:52:26
stack backtrace:
   0: rust_begin_unwind
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14
   2: core::option::expect_failed
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/option.rs:1615:5
   3: core::option::Option<T>::expect
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/option.rs:698:21
   4: doctave::navigation::Navigation::customize
             at /home/jona/projects/doctave/src/navigation.rs:50:42
   5: doctave::navigation::Navigation::build_for
             at /home/jona/projects/doctave/src/navigation.rs:23:26
   6: doctave::site_generator::SiteGenerator<T>::run
             at /home/jona/projects/doctave/src/site_generator.rs:45:26
   7: <doctave::site::InMemorySite as doctave::site::Site>::build
             at /home/jona/projects/doctave/src/site.rs:115:9
   8: doctave::serve::ServeCommand::run
             at /home/jona/projects/doctave/src/serve.rs:37:9
   9: doctave::serve
             at /home/jona/projects/doctave/src/main.rs:102:5
  10: doctave::main
             at /home/jona/projects/doctave/src/main.rs:52:33
  11: core::ops::function::FnOnce::call_once
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Since it's not possible to change the documentation root, I cannot compile the documentation, even with an (effectively useless) README.md present in the docs subdirectory.

Broken links checking

We should add a feature where we verify that internal links within a project are not broken.

Current plan would be that when running doctave build, we'd show any errors and fail the build if there are broken links, with a flag that allows for ignoring the error status.

I'm going to narrow this down to internal links only for now, as going over the network to check external links has lots of additional complexity (servers can go down, some internal systems may not be accessible from CI, etc).

Page title is not parsed when file contains Windows line endings

When generating a new Doctave site on Windows, doctave init, the Examples page is generated with Windows line endings. These line endings prevent the title from being parsed by Doctave and instead are included as markdown content, as if it were just markdown content. The same issue occurs when generating new files on Windows, because they also contain Windows line endings. After changing the files to Unix line endings then the title is parsed by Doctave and the page's title is displayed as expected.

Screenshot 2021-10-12 at 11-54-14 examples

Generate and serve site from memory in `serve` mode

Currently we rewrite the whole documentation site to disk on every change. It would be much better for us instead to generate the HTML in memory, and have the web server serve pages without touching disk.

This would both improve performance and spare the disks of users of extra work.

Linking to README pages results in broken links

I have a README.md page that links to two internal docs pages:

- [Developing](doc/dev/README.md):
- [Bazel](doc/dev/developing_bazel.md):

The first link to doc/dev/README.md doesn't work in doctave because doctave serves that page from doc/dev (no trailing /README.md).

The second links works as expected.

Add support for reading frontmatter in TOML

Currently the parser only supports frontmatter in yaml format:

---
title: "my title"
---

For compatability with other SSGs it would be cool to also support TOML format in the frontmatter

+++
title= "my title"
+++

The two are equivalent, but the toml is surrounded by +++ instead of ---.

As an example Zola SSG (getzola.org) supports both.

Cargo.lock file is out of sync

I was working on making a nix package for dotave and notcied that revision tagged as 0.4.2 has an outdated Cargo.lock file.

This prevents building this package offline and in a reproducible way. This is very easy to prevent in the future by using --frozen flag for cargo during CI.

looks the only thing that is different is version of doctave itself. i guess you tag a little bit to early ?

[FEATURE REQUEST] set path for build

A nice to have would be to be able to set a path for doctave build --release.

As a developer this removes the need to script a copy command into my tool chain simply to copy the contents of /site into /public/docs

Code in headings breaks `On this page` text

Hi there, just stumbled over this issue. If I have inline code in a heading, all succeeding text will be truncated.

To reproduce create a file with the contents:

# Foo `bar` baz

The right On this page navigation will have a single item of Foo , missing the rest of the title.

Add a version field in doctave.yaml

Maybe we could create a new version field in doctave.yaml ? This field would be optional, meaning that if it is not set, no version appears (like it is now). If it is set, it could be displayed in the upper left-hand corner, maybe like in one of these examples:

  • Directly with the title
    with_the_title
  • Under the title
    under
  • Next to the title
    next

I recommend making this yaml field a string rather than an int or a float, to handle versions like 3.0-alpha easily.

Question - livereload on dev

Hey :)
Thanks again for this project!
I started to play a bit with the source code (recent master, version 0.4.2) and noticed when in dev mode:
cargo run serve or ./target/debug/doctave serve
And editing one of the files of "docs" e.g. tutorial.md
The reload logs indicates the site rebuilt but the browser didn't reload the page

File /Users/.../.../doctave/docs/tutorial.md updated. Site rebuilt in 423.13685ms File /Users/.../.../doctave/docs/tutorial.md~ deleted. Site rebuilt in 434.936333ms

It won't happen when using the globally installed cli I installed with brew
doctave --version Doctave 0.4.2

System info:
Darwin C02F54NDMD6T 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 x86_64

What am I missing? :)
Thanks!

Distorted Format after building the site

Hello

I am tried to build a documentation site with the examples.md page as well as a few new pages added to it. However after building the site in release mode the contents of the html pages are distorted also the diagrams drawn with mermaidJS are not visible.
Can you help me out with this issue.

Screenshot (21)

Doctave documentation conflicts with other github pages

Hi!

First just want to say thanks for making this package, it's super slick and overall way easier to use than previous documentation builders I've tried.

I've just gotten to the point publishing my docs using the commands specified in the tutorial:

doctave build --release
gh-pages -d site

And this does work. GitHub pages picks up the documentation but it seems to conflict with some of the previous websites I've got set up.

The documentation I'm trying to build looks like this: Lorikeet
As you can see, it hasn't loaded correctly and I think this is because the directory structure seems to point to stuff in my github about me page thing: Rhys Newell

I've tried using the base_path variable in the doctave.yaml but that didn't seem to work. If you've got a fix for this please let me know

Cheers,
Rhys

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.