Quick install with Opam
The easiest way to install is to use Opam.
Install Opam, then, as a regular user, fetch and install an OCaml version and install Stog.
The whole can be done with the following opam commands:
$ opam init --compiler=5.1.0
$ opam update
$ opam install stog
Plugins can be installed one by one
or by installing the package stog_plugins:
$ opam install stog_plugins
# same as opam install stog_asy stog_dot stog_extern stog_markdown stog_multi_doc stog_nocaml stog_noexec stog_rel_href stog_sitemap stog_writing
The preview server is installed by
$ opam install stog_server
External tools required
You will need to have the following tools installed to use
some functions:
- highlight
to use syntax highlighting for languages not supported by
Higlo,
- LaTeX and dvisvgm to embed
LaTeX in your pages.
From the sources
Get the sources from git repository:
$ git clone https://framagit.org/zoggy/stog.git
Or pick one of the releases:
- 1.0.0
[March 13, 2024]
- highlight: issue only one
"Higlo: unknown language %s. Falling back to external highlight"
warning per unknown language,
- upgrade to ocaml >= 5.0.0,
- upgrade to Conduit >= 6.2.1,
- Use Js.Unsafe.pure_js_expr insteaf of Js.Unsafe.variable,
- upgrade to Higlo 0.9.
- 0.20.0
[December 2, 2021]
- use dune to build and install,
- rename modules and create separate packages,
- [fix] handle "_none_" filename in ocaml evaluation error/warning messages.
- 0.19.0
[May 17, 2021]
- fix invalid output of closing tags in markdown plugin when using omd,
- more debug in -D mode,
- upgrade to OCaml 4.12.0 and various library versions,
- main_ attribute must be used instead of main
to indicate main document (a deprecation warning is issued when main
is used).
- 0.18.0
[July 6, 2018]
- build fixes by Gabriel Scherer.
- 0.17.1
[May 3, 2017]
- move to websocket >= 2.8,
- export Stog_ocaml.eval_ocaml_phrase.
- 0.17.0
[November 30, 2016]
- use Uutf 1.0.0
and Xtmpl 0.16.0,
- Markdown plugin now uses
Omd, except if a
command attribute is specified in <markdown> node,
- use ocaml-uri
instead of Neturl,
- use Ptime
instead of Netdate,
- change of %-format usable in datetime
format,
- date attribute for
documents is now used to specify only dates;
to specify datetime, datetime
attribute for documents must now be used,
- fix: adapt to new behaviour of input_value in ocaml 4.03.0,
- sectionning rules now generate role="heading" and aria-level="...",
- <ocaml-eval> and
<exec> use <span>
instead of <div> in <pre> nodes, to
be HTML-correct (default styles are modified in consequence),
- <docs> now uses a
template; default is
doc-list.tmpl
but another one can be
specified with list-tmpl="..." attribute.
In this template, <alt-link/> is the url of the link
to (tyically) the RSS feed, and <items/> is the tree of
listed documents,
- sitemap plugin: fix date format (by Leo Wzukw),
- fix: handling of default
page.tmpl
(by avysk),
- fix: call tail in BSD-friendly way (by avysk),
- fix: hardcoded temp directory for latex (by avysk).
- 0.16.0
[November 25, 2015]
- require Xtmpl >= 0.13.0,
- a document's DOCTYPE is now taken from the XML template corresponding to the document's type,
- install
odoc_*
files in stog ocamlfind directory,
- new option
-pp
for stog-ocaml-session
,
- new <exec>
rule to execute commands and include output in documents,
- new directory attribute for <ocaml-eval>
to set the directory in which the stog-ocaml-session tool is launched,
- stog preview server: handle file dependencies to trigger recomputation of documents,
- now require lwt not only for server,
- change templates to use xhtml namespace,
- various fixes.
- 0.15.0
[July 7, 2015]
- require Xtmpl >= 0.12
and OCaml-Websocket >= 2.1,
--host
and --port
options are replaced by
--http
, --ws
, --public-http
and --public-ws
, which accept urls as values. The --public-...
options are used when the stog server is behing a proxy,
- New plugins: Stog_sitemap, Stog_nocaml
and Stog_extern,
stog-ocaml-session
now handles the -ppx
, -safe-string
and
-unsafe-string
options,
- <doc-intro> does not include "next" link with image; it is now
in the default
doc-in-list
template,
- use Ocf (0.3.0) instead of
Config-file; as a
consequence, previous configuration files
must be translated to JSON syntax,
- new tool Stog-tmpl to generate web site skeletons,
- new multiserver, with online editor.
- 0.14.0
[October 27, 2014]
- stog-ocaml-session now handles options -w and -warn-error,
- fix Mathjax CDN URL in article template,
- provided article template and math module (math.stm) now use
jquery.js and bootstrap-collapse.js (for foldable proofs),
- preview server:
- use Ojs-base facilities
to display messages in browser,
- a "recompute" button on top-left corner allows the reload of all
files (useful when adding new files to the edited web site sources),
- use ppx_deriving_yojson 2.0 (and so require ocaml 4.02.1).
- 0.13.0
[October 3, 2014]
- preview server (stog-server), using
xmldiff.js package and websockets,
- use Xtmpl 0.10 to unescape entities in attributes of final documents,
- new plugin Stog_rel_href,
- new rules <print-date>
and <print-datetime>,
- keep /index.html in urls when the site url scheme is "file:",
- handle subtitle in article default template,
- improve latex translator,
- allow use-parent-path="false" in cut,
not to use parent path when forging new elements' path,
- improve provided templates and math module,
- various fixes,
- replace calls to OCaml deprecated functions,
- use safe-string (require OCaml >= 4.02).
- 0.12.0
[May 16, 2014]
- [fix] missing include in mk-stog-ocaml-session,
- install default templates for pages and styles,
- --mods
adds a directory where to look for modules,
- handling a file or a list of files instead of a directory for
compiling single documents,
- --tmpl
now adds a directory to look for templates,
- OCaml toplevel output now highlights code corresponding to
warnings and errors; use highlight-locs="false" in <ocaml-eval ...>
to disable; when enabled, use print-locs="true" in <ocaml-eval ...>
to force printing also the warning and error locations.
To highlight the code, <span class="warning-loc">
and <span class="error-loc"> nodes are added,
- use more HTML blocks in output of <ocaml-eval>:
<div class="stderr"/>,
<div class="stdout"/>,
<div class="toplevel-out"/>.
- 0.11.1
[March 21, 2014]
- (fix) compute all documents when using --nocache
- 0.11.0
[March 20, 2014]
- the term "element" is replaced by "document", and all
<elt*> rules are replaced by <doc*> rules,
- the term "human id" is replaced by "path". In all rules and
attributes, "hid" is replaced by "path". The <doc-path> rule
is replace by <doc-navpath>,
- document path now includes the extension of the document's filename;
when referencing a document, the extension is only needed where
an ambiguity is possible between two documents whose paths differ
only by their extension,
- new rules <as-cdata>,
<late-cdata>,
<date-now>,
<date-today>,
- new option --publish-only,
- more generic way to define an alternative document when using
the <documents> rule,
- new attribute format="..." for rules
<date>, <datetime>,
<date-now> and <date-today>,
- defining twice the same id in a document is not an
error anymore but a warning is emitted,
- use Higlo syntax highlighter when possible,
- <cut-doc>: add previous-path and next-path in definitions
of cut documents, to create navigation links,
- merge CData in resulting XML trees when computing documents,
- urls of .../index.html documents now include a final "/",
- the new <stog-dir> rule is pre-defined to return the
absolute stog directory,
- (fix) compile and install odoc_stog.cmo,
- (fix) when creating by-topic, by-keyword and by-month documents,
update existing documents if they exist,
- (fix) default doc-in-list.tmpl template now handles
dependencies on listed documents,
- (fix) compile and install .cmxs files,
- 0.10.0
[January 21, 2014]
- Fix caching system,
- Use || instead of deprecated or.
- Change architecture of engine, introducing modules and fold-like
rewrite rules (following Xtmpl library),
- Do not use the main_ tag, but rather dummy_,
- <inc> is now deprecated and replaced by
<late-inc>,
- <include> and
<late-inc> both
handle
depend
, file
, href
,
id
, raw
and subs-only
attributes,
- New rule <cut-doc>
to split a document into pieces according to some nodes (equivalent
of Hevea's Hacha),
- Rules defined in documents now can use all attributes (parameters), with
default values for the ones specified in rule definition,
- New option
--local
,
- New base rule <doc-datetime>,
- New plugins: Asymptote, Graphviz and Stog_multi_doc,
- New
show-without-ids
attribute for
<prepare-toc>
to handle sections without id,
- New rules <ocaml-printf>,
<as-xml>, and
<prefix-svg-ids>,
- <latex> rule now uses
latex-packages
Stog environment variable
if no package
attribute is given,
- New LaTeX to Stog translator, not finished yet.
- 0.9.0
[September 24, 2013]
- New option follow-symlinks in .stog/config to follow symlinks
or not when building the file and directory source tree,
- For documents with doctype=html, prevent self-closing of tags, except
HTML5 void documents,
- New ocamldoc generator (odoc_stog.cm{o,xs})
to embed ocamldoc-generated documentation into sites generated with stog,
- <doc-*> predefined functions handle a
doc-hid="hid of document" attribute, to access information about
another document rather than the current one,
- Fix ocaml-eval: use return of Toploop.execute_phrase
to consider catched exceptions as errors if error-exc="true",
- Fix: allow list of CDATA in ocaml code,
- New --def command-line option
to define a global rule on command line,
- New doc-navpath rule, to create a navigation bar,
- Fix Malformed_URL bug when generating with a site-url having an empty path,
- hcode and icode now keep id attribute
in <pre> or <span> resulting document,
- Module Base handles id attribute to redefine the id of the included node,
- New filter attribute for the documents rule,
- documents handles ','- or ';'-separated list of document types.
- 0.8.0
[March 19, 2013]
- now depends on ocamlrss >= 2.1.0,
- handle
stog:archived-docs
to indicate the types of documents appearing
in archive tree,
- do not issue twice the same warning message,
- <latex> uses
latex-svg-scale
(default is 1.1) if defined in the environment when producing .svg
files.
- 0.7.0
[February 13, 2013]
- mod: split (un)install target into (un)install-lib and (un)install-bin,
- add: -I and -package options to stog-ocaml-session,
- add: new scripts mk-stog, mk-stog.byte, mk-stog-ocaml-session
to create custom stog and stog-ocaml-session,
- add: option --stog-ocaml-session to stog, to indicate the program
used to evaluate ocaml code,
- fix META file,
- add: support for authors in the RSS feed. Thanks to Gabriel Scherer,
- mod: use ocamlfind to compile.
- 0.6.1
[January 17, 2013]
- fix version number META file,
- remove Pcre useless dependency in Makefile and META.
- 0.6
[January 16, 2013]
- mod: do not write the config file if it already exists,
- add: <documents> node handles reverse="false" attribute not to
reverse order of documents (which is default, i.e. the more recent first),
- mod: better cache system, using dependencies of each document on other
documents and files; also handles the stog environment used to compute
documents in cache, so that a change in the stog environment will
make all documents recomputed (for example when language changes),
- add: a rule using a file or another document must add a dependency from
the computed document to the document or file it depends on, using
Stog_plug.add_dep,
- add: <include> now handles a depend="false" attribute, to prevent
adding a dependency of the document on the included file,
- add: --depcut option, used when getting cached documents, to use
only one level of dependency between documents; this is useful
for example in case the site has a menubar, leading to having
almost all documents depending on almost all documents.
- 0.5
[December 18, 2012]
- minor fixes (thanks to Gabriel Scherer),
- better error and warning messages (thanks to Gabriel Scherer),
- handle prefix in all xml nodes and attributes (upgrade to Xtmpl 0.5),
- global definitions now are of the form
stog:foo
,
- add: module system (not yet stable),
- add: new caching system, available for plugins too,
- add: Stog_plug.plugin_config_file,
- add: Stog_plug.register_level_fun_on_doc_list
to register functions handling all documents at a time.
- fix: add '.' after counters in section title,
- add: when a basic template is missing, create one and issue a warning;
these templates are:
page.tmpl
, doc-in-list.tmpl
,
by-keyword.tmpl
, by-topic.tmpl
, keyword.tmpl
,
topic.tmpl
, by-month.tmpl
.
- 0.4
[November 22, 2012]
- handle relative paths in <include>, when starting with
. or ..,
- use a separate tool to evaluate ocaml code, "stog-ocaml-session";
this allows to use native code version of stog even when evaluating
ocaml code; it also makes possible to use distinct ocaml toplevels in
ocaml-eval (with session="..."); details here,
- add simple cache system, and option --nocache,
- new <inc> rule to include a block from another
document: <inc doc-path="/install" id="blockid"/>,
- ability to define "functions", site-wide or document-wide,
- handle blocks and counters,
- sectionning now uses blocks and counters,
- a "sectionning" attribute is used to determine which nodes are used for
sectionning a document; default is "section,subsection",
- verify references to blocks by id (sections, ...) and use their title in links,
- use "id" attribute instead of "name" attribute in sectionning tags,
- define and use levels of rules; plugins can extend the number of levels
to define their own rewriting system.
- 0.3
[August 30, 2012]
- new stage 0 to allow plugins to change the stog structure before generating,
- new fields doc_xml_doctype, doc_out in
doc type,
- handle doctype attribute in document description,
- define and use stage1 and stage 2 functions for plugins,
- more .mlis file and comments in the library.
- 0.2
[August 28, 2012]
- change the format of files, now all in XML. Config and templates are in .stog
directory,
- less templates required,
- user can define documents of any "type" (post, page, ...).
- 0.1
[June 20, 2012]
Initial release.
Compilation
Just type
make install
This will compile and install stog, stog.byte,
stog-server, stog-server.byte,
stog-ocaml-session and stog-tmpl into the same directory as
ocamlc. This will also install the stog library and the
stog_asy,
stog_extern,
stog_dot,
stog_markdown,
stog_multi-doc,
stog_nocaml,
stog_rdf,
stog_rel_href,
stog_sitemap,
and stog_writing packages.
For information you can see the source code of the page.
<page title="Installation"
navbar-install="active"
with-contents="true"
>
<release version="">
<if version=""><error_><release>: missing version</error_></if>
<li><a href="https://framagit.org/zoggy/stog/-/archive/<version/>/stog-<version/>.tar.gz"><version/></a>
<span class="date">[<doc-date doc-path="release-<version/>"/>]</span>
<late-inc href="release-<version/>#changes" id="changes-<version/>"/>
</li>
</release>
<contents>
<prepare-toc depth="2">
<toc></toc>
<section id="opam" title="Quick install with Opam">
<p>
The easiest way to install is to use <ext-a href="http://opam.ocaml.org">Opam</ext-a>.
Install Opam, then, as a regular user, fetch and install an OCaml version and install Stog.
The whole can be done with the following opam commands:
</p>
<command-line>
$ opam init --compiler=5.1.0
$ opam update
$ opam install stog
</command-line>
<p><doc href="plugins">Plugins</doc> can be installed one by one
or by installing the package <icode>stog_plugins</icode>:</p>
<command-line>
$ opam install stog_plugins
# same as opam install stog_asy stog_dot stog_extern stog_markdown stog_multi_doc stog_nocaml stog_noexec stog_rel_href stog_sitemap stog_writing
</command-line>
<p>The <doc href="server">preview server</doc> is installed by</p>
<command-line>
$ opam install stog_server
</command-line>
</section>
<section id="extdeps" title="External tools required">
<p>
You will need to have the following tools installed to use
some functions:
</p>
<ul>
<li><ext-a href="http://www.andre-simon.de/doku/highlight/en/highlight.html">highlight</ext-a>
to use syntax highlighting for languages not supported by
<ext-a href="http://zoggy.frama.io/higlo/">Higlo</ext-a>,</li>
<li>LaTeX and <ext-a href="http://dvisvgm.sourceforge.net/">dvisvgm</ext-a> to embed
LaTeX in your pages.</li>
</ul>
</section>
<section id="download" title="From the sources">
<p>Get the sources from git repository:</p>
<command-line>$ git clone https://framagit.org/zoggy/stog.git</command-line>
<p>Or pick one of the releases:</p>
<ul>
<release version="1.0.0"/>
<release version="0.20.0"/>
<release version="0.19.0"/>
<release version="0.18.0"/>
<release version="0.17.1"/>
<release version="0.17.0"/>
<release version="0.16.0"/>
<release version="0.15.0"/>
<release version="0.14.0"/>
<release version="0.13.0"/>
<release version="0.12.0"/>
<release version="0.11.1"/>
<release version="0.11.0"/>
<release version="0.10.0"/>
<release version="0.9.0"/>
<release version="0.8.0"/>
<release version="0.7.0"/>
<release version="0.6.1"/>
<release version="0.6"/>
<release version="0.5"/>
<release version="0.4"/>
<release version="0.3"/>
<release version="0.2"/>
<release version="0.1"/>
</ul>
<subsection id="compilation" title="Compilation">
<p>
Just type
</p>
<command-line>make install</command-line>
<p>
This will compile and install <icode>stog</icode>, <icode>stog.byte</icode>,
<icode>stog-server</icode>, <icode>stog-server.byte</icode>,
<icode>stog-ocaml-session</icode> and <icode>stog-tmpl</icode> into the same directory as
<icode>ocamlc</icode>. This will also install the <icode>stog</icode> library and the
<icode>stog_asy</icode>,
<icode>stog_extern</icode>,
<icode>stog_dot</icode>,
<icode>stog_markdown</icode>,
<icode>stog_multi-doc</icode>,
<icode>stog_nocaml</icode>,
<icode>stog_rdf</icode>,
<icode>stog_rel_href</icode>,
<icode>stog_sitemap</icode>,
and <icode>stog_writing</icode> packages.
</p>
</subsection>
</section>
</prepare-toc>
</contents>
</page>