If you apply a heading style, you're telling Word that you've started a new part of your document. Styles also serve another important purpose: adding a hidden layer of organization and structure to your document. ![]() If you've already read our Applying and Modifying Styles lesson, you know they're an easy way to add professional text formatting to different parts of your document. However, with the right formatting, Word can create and update a table of contents automatically. And if you ever decide to rearrange your sections or add more information, you'll have to update everything all over again. The last task was publishing the final to a GitHub README.You could create a table of contents manually-typing the section names and page numbers-but it would take a lot of work. Here’s the finished Markdown in StackEdit: I had to fiddle with them, just adding and removing blank lines and using the different bullet symbols until I found something I liked. This is where the bulleted (unordered) list marks came in. ![]() Not bad! I still wanted to show the headings in hierarchy instead of a flat list, though. Here’s what it looked like in StackEdit after I had all the inline links set up: For Scope and everything after, it was easier for me to re-paste the “Purpose” link and just replace “#purpose” with “#scope” and so on for the rest of the headings. These links followed a predictable pattern (the heading name, lower case, with hyphens in place of spaces), so I only copied and pasted the link for the Purpose. This heading-specific URL is what goes in the (link) placeholder: () The target URL will be in the address bar, and the document will “snap” so that the selected heading is at the top of the screen. If you click the little link icon, the browser will reload. You will see the target URL for the header item’s link: While you are hovering the mouse over that little link icon, look at the bottom of the browser window (the status bar). In a GitHub Markdown file, if you hover the mouse over a heading, a little link icon appears: What should go in the (link) placeholder? I had to go back to my GitHub file to find that information. I knew what to put in the part: the section titles! So I filled those in with all the #, #, and # text in my document: (link) I made a bunch of inline link placeholders at the top of my document, after the title and document number. I went back to StackEdit to do the typing. When I published the StackEdit file to a GitHub README, the same content looked like this:Īfter I published my Markdown file to GitHub, I was ready to manually add a table of contents. Here’s what that looked like in StackEdit: My document had three levels of headings, so I went up to #. I followed the same organization as the original file, using # for the document title, # for first-level headings, # for second-level headings, and so on. ![]() Here’s how to make an inline link in Markdown:įirst, I wrote the file in Markdown. Here’s one way to make a bulleted (unordered) list in Markdown: The link text would be the title of the section, and the link would be to the corresponding section heading in the README file. The idea was to use Markdown bulleted lists and inline links to create a table of contents that meets these requirements.Clicking on the name of a section in the table of contents sends you directly to that section in the content itself. ![]() The table of contents on page 1 is what I wanted to recreate in Markdown for my GitHub README.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |