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

Adding MarkBind as an alternative docs option #156

Closed
wants to merge 23 commits into from
Closed
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
18 changes: 18 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: MarkBind Action

on:
push:
branches:
- master

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Build & Deploy MarkBind site
uses: MarkBind/markbind-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
rootDirectory: './docs'
baseUrl: '/addressbook-level3' # replace with your repo name
version: '^4.1.0'
23 changes: 23 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
_markbind/logs/

# Dependency directories
node_modules/

# Production build files (change if you output the build to a different directory)
_site/

# Env
.env
.env.local

# IDE configs
.vscode/
.idea/*
*.iml
10 changes: 6 additions & 4 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
layout: page
title: About Us
---
<frontmatter>
layout: default.md
title: "About Us"
</frontmatter>

# About Us

We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg).

Expand Down
10 changes: 6 additions & 4 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: page
title: Configuration guide
---
<frontmatter>
layout: default.md
title: "Configuration guide"
</frontmatter>

# Configuration guide

Certain properties of the application can be controlled (e.g user preferences file location, logging level) through the configuration file (default: `config.json`).
18 changes: 11 additions & 7 deletions docs/DevOps.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
layout: page
title: DevOps guide
---
<frontmatter>
layout: default.md
title: "DevOps guide"
pageNav: 3
pageNavTitle: "Table Of Content"
</frontmatter>

* Table of Contents
{:toc}
## DevOps guide

--------------------------------------------------------------------------------------------------------------------
<!-- * Table of Contents -->
<page-nav-print />

<!-- -------------------------------------------------------------------------------------------------------------------- -->

## Build automation

Expand Down
83 changes: 51 additions & 32 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
---
layout: page
title: Developer Guide
---
* Table of Contents
{:toc}
<frontmatter>
layout: default.md
title: "Developer Guide"
pageNav: 3
pageNavTitle: "Table Of Content"
</frontmatter>

# AB-3 Developer Guide

<!-- * Table of Contents -->
<page-nav-print />

--------------------------------------------------------------------------------------------------------------------

## **Acknowledgements**

* {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
* list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well

--------------------------------------------------------------------------------------------------------------------

Expand All @@ -21,10 +26,10 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md).

## **Design**

<div markdown="span" class="alert alert-primary">
<box type="tip">

:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
</div>
**Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
</box>

### Architecture

Expand Down Expand Up @@ -102,8 +107,10 @@ The Sequence Diagram below illustrates the interactions within the `Logic` compo

![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png)

<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
</div>
<box type="info">

**Note:** The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
</box>

Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command:

Expand All @@ -126,11 +133,13 @@ The `Model` component,
* stores a `UserPref` object that represents the user’s preferences. This is exposed to the outside as a `ReadOnlyUserPref` objects.
* does not depend on any of the other three components (as the `Model` represents data entities of the domain, they should make sense on their own without depending on other components)

<div markdown="span" class="alert alert-info">:information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.<br>
<box type="info">

**Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.<br>

<img src="images/BetterModelClassDiagram.png" width="450" />

</div>
</box>


### Storage component
Expand Down Expand Up @@ -180,32 +189,40 @@ Step 3. The user executes `add n/David …​` to add a new person. The `add` co

![UndoRedoState2](images/UndoRedoState2.png)

<div markdown="span" class="alert alert-info">:information_source: **Note:** If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`.
<box type="info">

**Note:** If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`.

</div>
</box>

Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state.

![UndoRedoState3](images/UndoRedoState3.png)

<div markdown="span" class="alert alert-info">:information_source: **Note:** If the `currentStatePointer` is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather
<box type="info">

**Note:** If the `currentStatePointer` is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather
than attempting to perform the undo.

</div>
</box>

The following sequence diagram shows how the undo operation works:

![UndoSequenceDiagram](images/UndoSequenceDiagram.png)

<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
<box type="info">

**Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.

</div>
</box>

The `redo` command does the opposite — it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state.

<div markdown="span" class="alert alert-info">:information_source: **Note:** If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone AddressBook states to restore. The `redo` command uses `Model#canRedoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
<box type="info">

</div>
**Note:** If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone AddressBook states to restore. The `redo` command uses `Model#canRedoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.

</box>

Step 5. The user then decides to execute the command `list`. Commands that do not modify the address book, such as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged.

Expand Down Expand Up @@ -270,14 +287,14 @@ _{Explain here how the data archiving feature will be implemented}_

Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*`

| Priority | As a …​ | I want to …​ | So that I can…​ |
| -------- | ------------------------------------------ | ------------------------------ | ---------------------------------------------------------------------- |
| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App |
| `* * *` | user | add a new person | |
| `* * *` | user | delete a person | remove entries that I no longer need |
| `* * *` | user | find a person by name | locate details of persons without having to go through the entire list |
| `* *` | user | hide private contact details | minimize chance of someone else seeing them by accident |
| `*` | user with many persons in the address book | sort persons by name | locate a person easily |
| Priority | As a …​ | I want to …​ | So that I can…​ |
|----------|--------------------------------------------|------------------------------|------------------------------------------------------------------------|
| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App |
| `* * *` | user | add a new person | |
| `* * *` | user | delete a person | remove entries that I no longer need |
| `* * *` | user | find a person by name | locate details of persons without having to go through the entire list |
| `* *` | user | hide private contact details | minimize chance of someone else seeing them by accident |
| `*` | user with many persons in the address book | sort persons by name | locate a person easily |

*{More to be added}*

Expand Down Expand Up @@ -329,10 +346,12 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Given below are instructions to test the app manually.

<div markdown="span" class="alert alert-info">:information_source: **Note:** These instructions only provide a starting point for testers to work on;
<box type="info">

**Note:** These instructions only provide a starting point for testers to work on;
testers are expected to do more *exploratory* testing.

</div>
</box>

### Launch and shutdown

Expand Down
34 changes: 22 additions & 12 deletions docs/Documentation.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
---
layout: page
title: Documentation guide
---
<frontmatter>
layout: default.md
title: "Documentation guide"
pageNav: 3
pageNavTitle: "Table Of Content"
</frontmatter>

# Documentation guide

**Setting up and maintaining the project website:**

* We use [**Jekyll**](https://jekyllrb.com/) to manage documentation.
* We use [**MarkBind**](https://markbind.org/) to manage documentation.
* The `docs/` folder is used for documentation.
* To learn how set it up and maintain the project website, follow the guide [_[se-edu/guides] **Using Jekyll for project documentation**_](https://se-education.org/guides/tutorials/jekyll.html).
* To learn how set it up and maintain the project website, follow the [_**MarkBind User Guide**_](https://markbind.org/userGuide/gettingStarted.html).
* Quick start:
* `cd docs # go to the docs folder`
* `npm i # install dependencies, only needed once when setting up the project`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about npm ci instead?

Copy link
Author

@tlylt tlylt Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If npm ci is used, then having a pin on the v4 version instead of the specific v4.1.0 may not make sense #156 (comment)

Because npm ci will not update the version of markbind-cli. Thoughts?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, then should we remove the package-lock file since that would get overwritten after npm i anyway?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, it will only be overridden when there are changes to the version downloaded? If we remove it, do you think we should gitignore the package-lock? I'm not sure if that's a common practice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually prefer pegging the version to a specific release for stability, and hence use npm ci. Tagging @damithc for comment on this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also prefer to peg to a specific release as future releases may introduce bugs. Using npm i may be risky.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change to npm ci for now

* `npm run serve # preview the website locally and make edits`
* Note these points when adapting the documentation to a different project/product:
* The 'Site-wide settings' section of the page linked above has information on how to update site-wide elements such as the top navigation bar.
* :bulb: In addition to updating content files, you might have to update the config files `docs\_config.yml` and `docs\_sass\minima\_base.scss` (which contains a reference to `AB-3` that comes into play when converting documentation pages to PDF format).
* If you are using Intellij for editing documentation files, you can consider enabling 'soft wrapping' for `*.md` files, as explained in [_[se-edu/guides] **Intellij IDEA: Useful settings**_](https://se-education.org/guides/tutorials/intellijUsefulSettings.html#enabling-soft-wrapping)
* The [_markbind/tweaking the page structure_](https://markbind.org/userGuide/tweakingThePageStructure.html) and [_markbind/site.json_](https://markbind.org/userGuide/siteJsonFile.html) pages have information on how to update site-wide elements such as the top navigation bar.
* :bulb: In addition to updating content files, you might have to update the config files `docs\site.json` and the layout files `docs\_markbind\layouts\default.md` (which contains a reference to `AB-3` that comes into play when converting documentation pages to PDF format).
* If you are using Intellij for editing documentation files, you can consider enabling 'soft wrapping' for `*.md` files, as explained in [_se-edu/guides **Intellij IDEA: Useful settings**_](https://se-education.org/guides/tutorials/intellijUsefulSettings.html#enabling-soft-wrapping)


**Style guidance:**

* Follow the [**_Google developer documentation style guide_**](https://developers.google.com/style).

* Also relevant is the [_[se-edu/guides] **Markdown coding standard**_](https://se-education.org/guides/conventions/markdown.html)
* Also relevant is the [_se-edu/guides **Markdown coding standard**_](https://se-education.org/guides/conventions/markdown.html)

**Diagrams:**

* See the [_[se-edu/guides] **Using PlantUML**_](https://se-education.org/guides/tutorials/plantUml.html)
* See the [_markbind/user-guide/diagrams **Using PlantUML with MarkBind**_](https://markbind.org/userGuide/components/imagesAndDiagrams.html#diagrams)

* See the [_se-edu/guides **Using PlantUML**_](https://se-education.org/guides/tutorials/plantUml.html)

**Converting a document to the PDF format:**

* See the guide [_[se-edu/guides] **Saving web documents as PDF files**_](https://se-education.org/guides/tutorials/savingPdf.html)
* See the guide [_se-edu/guides **Saving web documents as PDF files**_](https://se-education.org/guides/tutorials/savingPdf.html)
9 changes: 0 additions & 9 deletions docs/Gemfile

This file was deleted.

Loading