I want to create a hierarchy in my wiki like so:
General
FooPages
Foo1
Foo2
Foo3
ODP
Bar
Baz
I would like to create these pages, and use <<toc>>
table of contents macros to organize them.
How can I do that? Do I need to clone and edit the wiki on my own machine, or can I do that exclusively through the web interface?
When you add a repository to Bitbucket Cloud, you also get a wiki. The wiki is a simple place to keep documents. Some people use it as their project home page. The wiki is a Git repository, so you can clone it and edit it like any other source files.
Bitbucket is a Git-based source code repository hosting service owned by Atlassian. Bitbucket offers both commercial plans and free accounts with an unlimited number of private repositories.
Create a pageGo to the repository's Wiki link in the left panel. By default, you see the wiki Home page. Click Create page at the top to create a new wiki page.
You can (partially) do this, using <<toc / >>
.
This will create a TOC for all the headers in files in the root directory.
It will not list headers in file in the sub directories, though.
You can do the same for <<toc FooPages/ >>
etc.
You can do this both through the web interface and locally on your machine.
I placed some TOC examples on this Bitbucket wiki page: http://bitbucket.org/marijnvanderzee/build-wiki/wiki/TocTests. You can view the markup there.
Make sure to balance the equal signs on you headers; e.g. use == H2 ==
instead of == H2
.
Both are valid, but at this time, the latter is not recognized by the <<toc>>
macro.
Regarding the hierarchy side of this question, it's worth clarifying:
You can create a hierarchical structure by using the Title field when you create or edit a wiki page.
Eg: If you want to create a new file Bar.md inside a new Foo directory, just create a new page and in the Title field write "Foo/Bar.md". It will create the directory and the file at the same time.
I'm not sure if there's a way to just create the directory without adding a file to it straight away.
Regarding the TOC half of this question, I found that I can use the # HeaderTitle
syntax in Markdown pages, and Creole's TOC macro will recognise it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With