Files
metrics/source/templates/markdown/example.md
2021-04-26 22:28:39 +02:00

2.2 KiB

📒 Markdown template example

This is a markdown template example which explain the basic usage of this template.

See rendering of this file here and original template source here.

🈂️ Templating syntax:

  • Regular EJS syntax is supported
  • {{ and }} will be interpolated as EJS brackets (syntaxic sugar)
    • {% and %} can be used as control statements
  • Use metrics.lecoq.io with config.output=json to see available data
    • You can also use config_output: json in GitHub Actions and/or inspect metrics code to get available data too
  • Same formatting helpers available in templates can be used too
I joined GitHub on `{{ f.date(REGISTRATION_DATE, {dateStyle:"short"}) }}`.
I contributed to `{{ REPOSITORIES_CONTRIBUTED_TO }}` repositories and made `{{ COMMITS }}` commits.

🧩 Plugins

Using markdown plugins

Some plugins have their own markdown version which includes hyperlinks and reduce image overhead.

See compatibility matrix for more informations.


<%- await include(partials/activity.ejs) %>


<%- await include(partials/posts.ejs) %>


<%- await include(partials/rss.ejs) %>


<%- await include(partials/tweets.ejs) %>


<%- await include(partials/topics.ejs) %>

Embedding SVG metrics

To include SVGs metrics images without creating additional jobs, use the embed function:

<%- await embed(example-isocalendar, {isocalendar:true, isocalendar_duration:"full-year"}) %>

It takes two arguments:

  • An unique identifier which will be used as filename withing markdown_cache folder
  • Configuration options (see action.yml)
    • Tokens options are automatically passed down from your workflow job, do not pass them again
    • Options syntax is same as web instance (i.e. dots (.) instead of underscores (_) and no plugin_ prefixes)