Skip to content
ringpackagesPublic

Latest commit

 

History

25 Commits

Folders and files

Repository files navigation

RingDoc

A documentation generator for Ring packages, written in Ring. It makes a static HTML site (sidebar, search, syntax highlighting, previous/next links) from Markdown pages, and it can show the source and the real output of the Ring programs of a package.

ringdoc is the tool that was used for the documentation of RingDotNet, made general: the project (pages, name, folders) is described in one file, docproject.ring.

Install

ringpm install ringdoc from ringpackages

Use

Create a project:

ringdoc new mydocs "My Package"

Build the site (run it in the folder of docproject.ring):

ringdoc build

Or pass the file:

ringdoc build path/to/docproject.ring --refresh

--refresh runs the programs again; without it the outputs kept in the cache folder .ringdoc-cache are used.

The project file

aDocProject = [
	:name = "Hello",
	:tagline = "an example",
	:logo = "H",
	:description = "What the package does",
	:footer = "Hello - made with ringdoc.",
	:source = "src",        # the Markdown pages
	:output = "docs",       # the site
	:pages = [
		["index","Overview","Start"],    # [file, title, group]; groups make the sidebar
		["guide","Guide","Start"]
	]
]

PDF

ringdoc pdf [docproject.ring] [--html-only]

One PDF of all the pages (cover, contents, bookmarks, links between pages inside the PDF, source blocks open) in <output>/pdf/<name>-documentation.pdf.

It is printed by headless Chrome or Edge; without one, the HTML page ...-documentation.html is made and can be printed to PDF.

The cover is plain (name, tagline, description); a cover.svg in the project (with @NAME@ and @TAGLINE@), a pdfdoc.template or an assets/pdf.css replace or extend the defaults.

Documentation

The documentation of ringdoc is made with ringdoc:

  • docs/src (pages) and docs/docproject.ring; the built site is docs/site/index.html and the PDF docs/site/pdf/ringdoc-documentation.pdf.

  • To rebuild: cd docs; ringdoc build; ringdoc pdf.

Example and tests

  • samples/UsingRingDoc/hello is a small project.

  • ring samples/UsingRingDoc/tests/run.ring builds it, makes its PDF and checks the pages.

Releases

Packages

Contributors

Languages