Skip to main content

Crate ddoc

Crate ddoc 

Source
Expand description

ddoc is a markdown based static site generator.

Complete documentation at https://dystroy.org/ddoc

§Usage overview

Create a directory, then move to it

mkdir website & cd website

Initialize the site:

ddoc --init

This creates:

  • a .gitignore file, which eases inclusion of your site in a git managed project
  • a ddoc.hjson file, holding the basic properties and navigation
  • a src folder, for your markdown files, CSS style sheets and images
  • a plugins folder, with default plugins

To build your site, run

ddoc

This updates a site directory, whose content can be sent to your server.

To test it locally, run

ddoc --serve

Then have a look at the documentation to improve your site.

Modules§

before_0_11
This module ensures compatibility with configuration from versions 0.1 to 0.11
before_0_16

Structs§

Args
Launch arguments
CargoToml
CargoTomlPackage
Config
Element
ElementKey
ElementList
A collection of elements, a vessel for deserializing
ElementListDeserializer
EmbeddedPlugin
InitValues
Menu
The settings for the insertion of a menu in a web page.
Module
Either the main project or a plugin
NavLink
A single link in the navigation bar
Page
PageList
PagePath
PageWriter
Project
A ddoc project, with its configuration, pages, and location which allows building it.
Server
Sourced
StaticEntry
Implicit reference to one of the files in /src/js or /src/css
Toc
The settings for the insertion of a table of content in a web page.
WatchTarget
Something that should be watched for changes to trigger a rebuild of the project

Enums§

AttributeValue
The value of an attribute in a ddoc element (ddoc-link, ddoc-menu, etc).
DdError
ElementContent
ElementType
FileChange
ListItem
NavLinkPart
Text

Constants§

DDOC_VERSION

Statics§

CONFIG_FILE_NAME
HTML_START
MAIN_CSS_BYTES

Functions§

compare_versions
copy_normal_recursive
Copy normal non hidden files from src_dir to dst_dir recursively
duration_since
escape_attr
escape_hjson_string
escape_text
find_file_ignore_case
fix_old_config
For support of old ddoc versions (<= 0.11), convert old nav components if the new body field is empty
init_ddoc_project
init_hjson_in_dir
Initialize a ddoc.hjson file in the specified directory (do nothing if one already exists)
init_src_in_dir
Create and fill the src/ directory in the given dir.
is_current_version_older_than
plugin_is_known
project_subdirectory
Search direct subdirectories of parent for a ddoc project (a directory containing a valid ddoc.hjson file).
read_file
Deserialize an object from a JSON, TOML, or HJSON file.
rebuild_on_change
watch for file changes to keep a project up to date
resource_file_bytes
Get the bytes of a file from the plugin name and the path starting from its src/ directory (e.g. “css/main.css”)
run
Run the ddoc command line application

Type Aliases§

AttributeKey
Attributes
ClassName
DdResult