Usage


Add a Scribe field to an entry type. When editing, choose a readme file — the menu lists each repository of yours that has one, with its filename alongside. The Start From / End Before menus then populate from that readme's headings (End Before only offers headings after Start From).

The field has two settings of its own. Show Preview renders the selected section right in the editor. Hide Images leaves images out of the rendered README, taking any link or paragraph they emptied with them — useful for dropping a badge row, and for private repositories, whose images your visitors can't load (GitHub serves them only to authenticated requests, so they'd show as broken).

Render it in a template:

Twig
{# The full README (or the chosen section) as HTML #}
{{ entry.myField.render() }}

{# Drop a leading heading that duplicates the page title #}
{{ entry.myField.render(entry.title) }}

{# Raw values #}
{{ entry.myField.url }}
{{ entry.myField.startFrom }}
{{ entry.myField.endBefore }}

{# All of the source's headings: [{ value, label, level }] #}
{% for h in entry.myField.headings %}{{ h.label }}{% endfor %}

render() returns GitHub-rendered HTML with repo-relative image/link URLs absolutized. Code blocks are emitted as a minimal <pre><code class="language-…"> by default. Point the Code Block Template setting at a site template (given code and language) to use your own themed markup.