markdown with level 1 headers as navbar

I got a markdown with a lot of content (tabbed sections, graphs, text). I'd like the first level headings to become a navbar like in flexdashboard or bookdown site.

I failed to use flexdashboard cause it's need structured layout and I need fit chapters content "as is".

Bookdown seems to be an overkill cause it need lot of additional files (index.Rmd).

Am i missing something? Can dashboard include "raw" markdown? Can bookdown site be based on one Rmd file?

Maybe I missing something obvoius.

I believe dashboard can have raw markdown but without an example I am not sure what you are trying to do.

you mean this pagedown ?

because there is a single format possible with it, but I am not sure there is the feature you are looking for.

Having an example of what you tried, or what you want would help avoid misunderstanding probably;


I meant bookdown site (but in my head site -> page -> pagedown :see_no_evil:) I will add example

Lets say I have this:

title: "Test"
output: html_document

# The Introduction

# details {.tabset}

## Detail 1

Hi! (detail 1)

## Detail 2 {.tabset}

Another set of tabs (in detail 2)

### This is 2:1

inside 2:1

### This is 2:2

inside 2:2

### This is 2:3

inside 2:3

## Detail 3

detail 3


# remarks

Some text

DT::datatable(iris, options = list(paging=FALSE))

Output is:


If I change header to

title: "Test"
output: flexdashboard::flex_dashboard

I got navbar but content is messed up (if there is more things they are flatten or placed in containers as in dasboard should)

Bookdown site require large setup (separate project) so I don't even start.

What I want is to combine dashboard with markdown:

This is special and specific layout that you need. flexdashboard feature are levering a special markdown syntax to create a navbar layout, by using the h1 level (#) as navbar component.

tabset component as you used is a special feature for html_document also leveraging some markdown syntax.

But the two are not compatible without respecting flexdashboard special markup. Tabset are supported with Flexdashboard but following this way

We don't have a format that is in between (have navbar created with # header without other flexdashboard feature).

However, you can have navbar layout using website structure. Did you try already R Markdown website

It is more oriented toward website project but it can help creating a navbar. You have to split your one Rmd in several though, or use links to section in the navbar. it may require tweaks to get exactly what you need.

You should be able to use navbar with a single document too if you provide a _navbar.html with HTML code directly, or _navbar.yml with YAML definition has in website doc. This will get picked up by html_document. However, if will still require some tweaks if you want to have h1 be transformed in navbar component.

More complex though and not as straightforward

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.