Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

Markdown Document Navigation

I wasnโ€™t able to find good documentation on this, so thought Iโ€™d make a post here in case anyone is trying to do something similar.

You can create a navigation sidebar for Markdown documents using this format at the top of each Markdown document:

---
title: Help Center
navigation:
  - section: Help Center
  - document: overview_doc
    label: Overview
  - document: data_sources_doc
    label: Data Sources
  - document: data_definitions_doc
    label: Data Definitions
  - document: faq_doc
    label: FAQ
  - document: release_notes_doc
    label: Release Notes
---

And it will appear as a sidebar like this:
markdown_sidebar

Users can get there from any dashboard by clicking a Help link at the top of every page. We created that link by adding a text tile with HTML at the top of each page:

  - name: Help Link
    type: text
    title_text: "<a href='/projects/model/documents/overview_doc.md' ><i class='fa fa-question-circle' aria-hidden='true'></i> Help</a>"

And it looks like this:
help_link

The icon comes from the Font Awesome library.

Hope this is helpful to someone!

11 22 9,857
22 REPLIES 22

This is great stuff. I just thought I should drop a link back to an old question that was posted on discourse regarding markdown document navigation. Check it out at Adding Markdown Document to a Dashboard.

Thanks for this, I have been searching around for this syntax and it isnโ€™t anywhere online!
I am struggling setting the document to a location other than the current path (I am spreading my documentation out across the projects in which the documentation refers).
Anywhere I can do some more reading or any help greatly appreciated.

izzymiller
Former Googler

Iโ€™ve been trying to figure this one out with the help of a few others, and I canโ€™t find much more than you. Our docs do have this: https://docs.looker.com/data-modeling/getting-started/other-project-files#adding_a_navigation_struct... which explains the use of the syntax, but donโ€™t shed light on how to reference another project.

We are on the hunt internally, and weโ€™ll definitely figure it out one way or the other. Stay tuned.

izzymiller
Former Googler

It looks like itโ€™s not currently possible to reference documents from other projectsโ€” Worth opening a feature request for! I suppose you could add literal links to get there, but it wonโ€™t mesh as nicely.

I am far from even a rookie with html/css/md but something seems off. This page suggests that the css tag of โ€œfloatโ€ is ok, yet on a md document page I cant get anything to stick to either side (I am making my own navigation panel). It just puts everything into the middle of the page. I can hack it around so that it pushes it to the left by putting stuff on the right of it but this is going to mess up with different screen sizes and is far from consistent.
Anyone offer any help here?

izzymiller
Former Googler

That docs page specifically references which parameters are allowed in the html parametersโ€” I think the dashboard text is actually โ€œGithub Flavored Markdownโ€, which includes some but not all the functionality of HTML.

I wonder if markdown just doesnโ€™t support the use of those kinds of tags? That seems unlikely to me.

Getting this some visibility from those who know just what Lookerโ€™s markdown is capable ofโ€ฆ

Hi, any news on this one?

izzymiller
Former Googler

I did some research but similarly couldnโ€™t figure it out, waiting on the engineers who created our markdown implementation to get back to me. I wonโ€™t forget to update this thread.

Any info about this, wanting to implement this dispersed home page where each team looks after their own page from their own projects but I own the central page. Cant use the navigation function the OP posted about but wishing to create my own navigationโ€ฆstuck to the left side of the page.

izzymiller
Former Googler

It looks like this page: https://docs.looker.com/dashboards/using-markdown-in-text-tiles which lists whatโ€™s allowed in text tiles, is also the reference for .md files in projects.

The following Markdown syntax is not supported in dashboard text tiles:

Math
Images with alt text
Links with alt text
Language-specific syntax highlighting
Headers
Strikethrough using two tildes
Sublists
Indentation

also donโ€™t seem to work in a .md file, which is a hint that itโ€™s the same set of rules.

izzymiller
Former Googler

I felt lazy for just saying that. I found out what library we use to create our markdown, and while Iโ€™m not sure if thatโ€™s privileged info or not (if I find out itโ€™s not, I can share), I discovered some secrets you may enjoy. Hereโ€™s a particularly salient one!

While markdown floating doesnโ€™t seem to work very well, try HTML.

<div style="float: right">
stick to the right!
</div>

This was what I had tried and mentioned above, in the css style tag and float didnโ€™t work for me on a md document page, just comes up in the middle of the page!

izzymiller
Former Googler

Oh, weird! I wasnโ€™t sure what syntax youโ€™d tried.

Mine looks like this, with that syntax:

I guess it is kind of the middle of the page. There must be a margin of some kindโ€ฆ Is that what youโ€™re referring to?

I tried float left (want navigation on the left). Seems float left and not trying to do anything with it results in the same alignmentโ€ฆmiddle of the page.

izzymiller
Former Googler

Oh I get itโ€” You want it where my x-marks-the-spot is?:

I think this must be the same sort of default margin thatโ€™s present on dashboard text tiles, which as far as I know is enforced by the pre-packaged Looker CSS and canโ€™t be changed.

sad times, sticking navigation in the middle of the page looks bizarre, the built in md navigation this post is about is perfect apart from it has to be in the same project.

izzymiller
Former Googler

Yeah, that would be the easiest way for sure. Iโ€™ve asked if itโ€™d be possible to add that capability.

izzymiller
Former Googler

izzymiller
Former Googler

A post was split to a new topic: Markdown navigation not compatible with IDE folders

cgunn
New Member

Hi, is there any update on this one? Weโ€™re using a .md file to produce a data dictionary, but because the default margins are so wide, itโ€™s causing much of the text to wrap within the cells of the table. Has a way to reduce the margins in the .md file been discovered?

@haleyb we really like this idea of being able to keep our documentation inside of our Looker repo and making it available from within Looker, rather than having to maintain and make that doc available somewhere else outside of Looker, so thanks for sharing!

However, it seems that users must have the ability to at least view LookML in order to view these documentation (.md) files - in the default Looker roles, that equates to having at least the User role.

We have some users that only have the Viewer role, meaning that it doesnโ€™t appear theyโ€™re able to view any of these documentation files, which kind of makes using documentation here not as valuable, as not all Looker users can benefit from it.

I bring this up out of curiosity to see if (a) Iโ€™m mistaken about Viewer role users not being able to view this documentation or if (b) you or anyone else has similar documentation requirements and woes related not all of their users being able to take advantage of documentation files that live in your Looker repo and what youโ€™ve done to get around that constraint or what youโ€™ve done documentation-wise instead.

Perhaps @izzymiller could shed some light/weigh in here as well.

Thanks!

I actually think Iโ€™ve answered my own question - it is possible for a Viewer user to view .md documents, via the in-app โ€œviewโ€ URL for these types of documents, e.g.

looker.com/projects/your_project/documents/DOCUMENT.md

Top Labels in this Space