Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intra-site link instructions to docs #2276

Merged
merged 9 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/devGuide/bootcamp/implementAFeature.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ _(Same as what we mentioned in the previous task)_

By this time, you should have a good idea about how tests and documentation are written. Where possible, unit tests should also be added to ensure that the feature works as expected. Utilizing the new feature in our documentation is also encouraged so that we can get a better idea of how the feature can be used.

<box type="important" light>

When adding intra-site links, do remember to use tags to differentiate between the deployment environment when appropriate as mentioned in [Adding Intra-Site Links to Documentation](/devGuide/development/workflow.html#adding-intra-site-links-to-documentation)!
itsyme marked this conversation as resolved.
Show resolved Hide resolved

</box>

## Create PR & Follow up with the Reviews

_(Same as what we mentioned in the previous task)_
Expand Down
36 changes: 36 additions & 0 deletions docs/devGuide/development/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,42 @@ Once you're done, be sure to run the `updatetest` script mentioned [above](#upda

</div>

## Documenting

### Adding Intra-Site Links to Documentation

Due to the way MarkBind's documentation is deployed, links from the developer guide that refer to the user guide, or vice versa, have to be differentiated with <a tags="environment--combined" href="/userGuide/tweakingThePageStructure.html#plugin-tags">tags</a><a tags="environment--dg" href="https://markbind.org/userGuide/tweakingThePageStructure.html#plugin-tags">tags</a>. Intra-site links within the developer guide or user guide need not have tags. MarkBind's documentation currently has 3 tags:
itsyme marked this conversation as resolved.
Show resolved Hide resolved

- `environment--combined` for deploying the User Guide and Developer Guide together
- `environment--ug` for deployed User Guide
- `environment--dg` for deployed Developer Guide

Tags allow you to selectively filter content when building a site. Using them with the links helps to filter the correct link to be rendered for the right environment, ensuring that the correct link is created. When the User Guide and Developer Guide are deployed together, both guides have access to the files from the other, allowing the relative link to work. However, when they are deployed individually, this is not the case. Using absolute links creates the same effect as the relative link without having to have access to the files from the other guide.
itsyme marked this conversation as resolved.
Show resolved Hide resolved

#### Developer Guide
%%LINK:%%
```markdown
[Link Title](/userGuide/newPage.html)
```

%%REPLACED WITH:%%
```html
<a tags="environment--combined" href="/userGuide/newPage.html">Link Title</a>
<a tags="environment--dg" href="https://markbind.org/userGuide/newPage.html">Link Title</a>
```

#### User Guide
%%LINK:%%
```markdown
[Link Title](/devGuide/newPage.html)
```

%%REPLACED WITH:%%
```html
<a tags="environment--combined" href="/devGuide/newPage.html">Link Title</a>
<a tags="environment--ug" href="https://markbind.org/devdocs/devGuide/newPage.html">Link Title</a>
```

## Linting

We follow [our style guides](../styleGuides.html). Using a linter will help check and fix some of the code style errors in your code. It will save time for both you and your code reviewer. The linting tool we use is [ESLint](https://eslint.org/) and [StyleLint](https://stylelint.io/). Here is a [gist](https://gist.github.com/nicholaschuayunzhi/bfe53dbb5f1a0f02d545d55956f9ab7e) with an explanation of the ESLint rules chosen in markbind-cli.
Expand Down