A rebar3_edoc_extensions - for build documentation with awesome style!

Foreword

Few days ago we was meet online with @dumbbell to discuss awesome CSS/JavaScript style what he made for amazing library khepri(here this documentation The khepri application). I’m ask if he don’t mind if will be created a rebar plugin where any project which uses this plugin can be able to use the same styles - and yey, he wasn’t mind :partying_face:. Meet new plugin rebar3_edoc_extensions!

Usage

  • Add into rebar.config: {project_plugins, [rebar3_edoc_extensions]}.
  • Run command for build Erlang documentation for project: rebar3 edoc_extensions

3d party of CSS/JavaScript

Notes

Under hood of course used updating state of edoc_opts section in rebar.config. So, make sure that you don’t use any important/specific configuration for options: stylesheet, xml_export, layout, doclet. As before can be defined overview.edoc - new styles also will applied automatically for this file. Also you don’t need to call rebar3 edoc - the command rebar3 edoc_extensions will generate documentation use the same way. Also, make sure that before publishing your awesome libraries/applications into hex.pm you use rebar3 edoc_extensions instead of rebar3 edoc - otherwise only you can see this wonderful design locally, so don’t be greedy and share with users of your libraries/applications :stuck_out_tongue_winking_eye: on hex.pm.

Afterword

Attentive GitHub user can may notice that this plugin was generated in few second by great rebar template rebar3_plugin what we make with @elbrujohalcon recently.(Rebar3_plugin - a simple rebar3 template to build your own with Rebar3 plugin!). Feel free to save time too withuse the same way! :metal:

9 Likes

Hi folks! Today together with @dumbbell we were made first stable release of rebar3_edoc_extensions :metal:

What was changed? Well, first of all was changed the command for generating documentation, now it looks like:

$ rebar3 edoc

Second point is - now CSS/JavaScript files are downloaded from URL instead of being static in the plugin. And last important changes is adding new configuration options:

  • Select the version of PrismJS to download( The default version is "v1.26.0"):
{prismjs_version, "v1.26.0"}.
  • Select the PrismJS theme( The default theme is "default"):
{prismjs_theme, "twilight"}.
  • Select the list of languages to support(The default languages are "erlang" and "elixir"):
{prismjs_languages, ["erlang", "javascript"]}.

Enjoy :metal: and let us know what you think about this library and what we can improve for you!

2 Likes