Skip to content

Support rendering tables of wiki front-matter

Steve Mokris requested to merge (removed):228538-wiki-page-table into master

What does this MR do?

Adds <FrontMatterTable /> wiki tag. See #228538 (closed).

Examples of supported syntax:

<!-- Render a table of all front-matter of pages in the current wiki directory: -->
<FrontMatterTable />

<!-- Specify an absolute wiki directory: -->
<FrontMatterTable path="/Some-Folder" />

<!-- Specify a relative wiki directory: -->
<FrontMatterTable path=".." />

<!-- Restrict the table to only showing some front-matter columns: -->
<FrontMatterTable columns="some_key,some_other_key" />

<!-- Also show the full content of each wiki page: -->
<FrontMatterTable content />

<!-- Truncate the content of each wiki page to 80 characters: -->
<FrontMatterTable content-truncated=80 />

Screenshots

Create some wiki pages with front-matter like this:

Screen_Shot_2020-08-09_at_21.08.18

Then create an index page with a tag like this:

Screen_Shot_2020-08-11_at_21.35.14

And the index page will render a table like this:

Screen_Shot_2020-08-09_at_21.03.35

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

  • To test, first create the wiki pages with front-matter
    • (For now, you need to create the wiki pages with front-matter before enabling the :wiki_front_matter feature flag, due to #234899.)
  • Then enable the feature flags:
bundle exec rails console
Feature.enable(:wiki_front_matter)
Feature.enable(:front_matter_table)

Closes #228538 (closed)

/cc @alexkalderimis, since you worked on !27706 (merged)

Edited by Steve Mokris

Merge request reports