diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000000..391c46b4fe9 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,34 @@ +name: Java CI + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + + steps: + - name: Set up repository + uses: actions/checkout@master + + - name: Set up repository + uses: actions/checkout@master + with: + ref: master + + - name: Merge to master + run: git checkout --progress --force ${{ github.sha }} + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + java-package: jdk+fx + + - name: Build and check with Gradle + run: ./gradlew check diff --git a/.gitignore b/.gitignore index 5e59b862ba4..71c9194e8bd 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ src/test/data/sandbox/ # MacOS custom attributes files created by Finder .DS_Store +docs/_site/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 924a42eb8da..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: java -matrix: - include: - - jdk: openjdk11 - -script: >- - ./config/travis/run-checks.sh && - ./gradlew clean checkstyleMain checkstyleTest test coverage coveralls asciidoctor - -deploy: - skip_cleanup: true - provider: script - script: ./config/travis/deploy_github_pages.sh - on: - branch: master - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/README.adoc b/README.adoc deleted file mode 100644 index d34211c9341..00000000000 --- a/README.adoc +++ /dev/null @@ -1,36 +0,0 @@ -= Address Book (Level 3) -ifdef::env-github,env-browser[:relfileprefix: docs/] - -https://travis-ci.org/se-edu/addressbook-level3[image:https://travis-ci.org/se-edu/addressbook-level3.svg?branch=master[Build Status]] -https://ci.appveyor.com/project/damithc/addressbook-level3[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]] -https://coveralls.io/github/se-edu/addressbook-level3?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level3/badge.svg?branch=master[Coverage Status]] -https://www.codacy.com/app/damith/addressbook-level3?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level3&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/fc0b7775cf7f4fdeaf08776f3d8e364a[Codacy Badge]] -https://gitter.im/se-edu/Lobby[image:https://badges.gitter.im/se-edu/Lobby.svg[Gitter chat]] - -ifdef::env-github[] -image::docs/images/Ui.png[width="600"] -endif::[] - -ifndef::env-github[] -image::images/Ui.png[width="600"] -endif::[] - -* This is a desktop Address Book application. It has a GUI but most of the user interactions happen using a CLI (Command Line Interface). -* It is a Java sample application intended for students learning Software Engineering while using Java as the main programming language. -* It is *written in OOP fashion*. It provides a *reasonably well-written* code example that is *significantly bigger* (around 6 KLoC)than what students usually write in beginner-level SE modules. - -== Site Map - -* <> -* <> -* <> -* <> -* <> - -== Acknowledgements - -* Some parts of this sample application were inspired by the excellent http://code.makery.ch/library/javafx-8-tutorial/[Java FX tutorial] by -_Marco Jakob_. -* Libraries used: https://openjfx.io/[JavaFX], https://github.com/FasterXML/jackson[Jackson], https://github.com/junit-team/junit5[JUnit5] - -== Licence : link:LICENSE[MIT] diff --git a/README.md b/README.md new file mode 100644 index 00000000000..13f5c77403f --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) + +![Ui](docs/images/Ui.png) + +* This is **a sample project for Software Engineering (SE) students**.
+ Example usages: + * as a starting point of a course project (as opposed to writing everything from scratch) + * as a case study +* The project simulates an ongoing software project for a desktop application (called _AddressBook_) used for managing contact details. + * It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC) than what students usually write in beginner-level SE modules, without being overwhelmingly big. + * It comes with a **reasonable level of user and developer documentation**. +* It is named `AddressBook Level 3` (`AB3` for short) because it was initially created as a part of a series of `AddressBook` projects (`Level 1`, `Level 2`, `Level 3` ...). +* For the detailed documentation of this project, see the **[Address Book Product Website](https://se-education.org/addressbook-level3)**. +* This project is a **part of the se-education.org** initiative. If you would like to contribute code to this project, see [se-education.org](https://se-education.org#https://se-education.org/#contributing) for more info. diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 277f1f2c510..00000000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 6f53e7cd2d6..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,18 +0,0 @@ -# AppVeyor configuration file -# For more details see https://www.appveyor.com/docs/build-configuration/ - -# Call on gradle to build and run tests -# --no-daemon: Prevent the daemon from launching to prevent file-in-use errors -# when we cache the ~/.gradle directory -build_script: - - gradlew.bat --no-daemon assemble checkstyleMain checkstyleTest - -test_script: - - gradlew.bat --no-daemon test - -environment: - JAVA_HOME: C:\Program Files\Java\jdk11 # Use 64-bit Java - -# Files/folders to preserve between builds to speed them up -cache: - - C:\Users\appveyor\.gradle diff --git a/build.gradle b/build.gradle index 93029ef8262..f73f45003d5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,20 +1,10 @@ -// Gradle Configuration File -// For more details take a look at the Java Quickstart chapter in the Gradle -// user guide available at http://gradle.org/docs/5.2.1/userguide/tutorial_java_projects.html - -import org.gradle.api.tasks.testing.logging.TestLogEvent - plugins { id 'java' - id 'jacoco' id 'checkstyle' - id 'com.github.kt3k.coveralls' version '2.4.0' id 'com.github.johnrengelman.shadow' version '4.0.4' - id 'org.asciidoctor.convert' version '1.5.6' id 'application' } -// Specifies the entry point of the application mainClassName = 'seedu.address.Main' sourceCompatibility = JavaVersion.VERSION_11 @@ -29,14 +19,6 @@ checkstyle { toolVersion = '8.1' } -jacocoTestReport { - reports { - xml.enabled false - csv.enabled false - html.destination file("${buildDir}/jacocoHtml") - } -} - test { useJUnitPlatform() } @@ -72,84 +54,4 @@ shadowJar { destinationDir = file("${buildDir}/jar/") } -task coverage(type: JacocoReport) { - sourceDirectories.from files(sourceSets.main.allSource.srcDirs) - classDirectories.from files(sourceSets.main.output) - executionData.from files(jacocoTestReport.executionData) - afterEvaluate { - classDirectories.from files(classDirectories.files.collect { - fileTree(dir: it, exclude: ['**/*.jar']) - }) - } - reports { - html.enabled = true - xml.enabled = true - } -} - -coveralls { - sourceDirs = sourceSets.main.allSource.srcDirs.absolutePath - jacocoReportPath = "${buildDir}/reports/jacoco/coverage/coverage.xml" -} - -tasks.coveralls { - dependsOn coverage - onlyIf { System.env.'CI' } -} - -test { - testLogging { - events TestLogEvent.FAILED, TestLogEvent.SKIPPED - - // Prints the currently running test's name in the CI's build log, - // so that we can check if tests are being silently skipped or - // stalling the build. - if (System.env.'CI') { - events << TestLogEvent.STARTED - } - } - - jacoco { - destinationFile = new File("${buildDir}/jacoco/test.exec") - } -} - -asciidoctor { - backends 'html5' - sourceDir 'docs' - outputDir "${buildDir}/docs" - - options = [ - template_dirs: [file("${sourceDir}/templates")], - ] - - attributes = [ - linkcss: true, - stylesheet: 'gh-pages.css', - 'source-highlighter': 'coderay', - icons: 'font', - experimental: true, - sectlinks: true, - idprefix: '', // for compatibility with GitHub preview - idseparator: '-', - 'site-root': "${sourceDir}", // must be the same as sourceDir, do not modify - 'site-name': 'AddressBook-Level3', - 'site-githuburl': 'https://github.com/se-edu/addressbook-level3', - 'site-seedu': true, // delete this line if your project is not a fork (not a SE-EDU project) - ] - - options['template_dirs'].each { - inputs.files fileTree(it) - } -} - -// Copies stylesheets into the directory containing generated HTML files as -// Asciidoctor does not copy linked CSS files to the output directory when rendering. -// This is needed for linked stylesheets and embedded stylesheets which import other files. -task copyStylesheets(type: Copy) { - from "${asciidoctor.sourceDir}/stylesheets" - into "${asciidoctor.outputDir}/html5/stylesheets" -} -asciidoctor.dependsOn copyStylesheets - -defaultTasks 'clean', 'test', 'coverage', 'asciidoctor' +defaultTasks 'clean', 'test' diff --git a/docs/AboutUs.adoc b/docs/AboutUs.adoc deleted file mode 100644 index 458e6134f45..00000000000 --- a/docs/AboutUs.adoc +++ /dev/null @@ -1,56 +0,0 @@ -= About Us -:site-section: AboutUs -:relfileprefix: team/ -:imagesDir: images -:stylesDir: stylesheets - -AddressBook - Level 3 was developed by the https://se-edu.github.io/docs/Team.html[se-edu] team. + -_{The dummy content given below serves as a placeholder to be used by future forks of the project.}_ + -{empty} + -We are a team based in the http://www.comp.nus.edu.sg[School of Computing, National University of Singapore]. - -== Project Team - -=== John Doe -image::damithc.jpg[width="150", align="left"] -{empty}[http://www.comp.nus.edu.sg/~damithch[homepage]] [https://github.com/damithc[github]] [<>] - -Role: Project Advisor - -''' - -=== John Roe -image::lejolly.jpg[width="150", align="left"] -{empty}[http://github.com/lejolly[github]] [<>] - -Role: Team Lead + -Responsibilities: UI - -''' - -=== Johnny Doe -image::yijinl.jpg[width="150", align="left"] -{empty}[http://github.com/yijinl[github]] [<>] - -Role: Developer + -Responsibilities: Data - -''' - -=== Johnny Roe -image::m133225.jpg[width="150", align="left"] -{empty}[http://github.com/m133225[github]] [<>] - -Role: Developer + -Responsibilities: Dev Ops + Threading - -''' - -=== Benson Meier -image::yl_coder.jpg[width="150", align="left"] -{empty}[http://github.com/yl-coder[github]] [<>] - -Role: Developer + -Responsibilities: UI - -''' diff --git a/docs/AboutUs.md b/docs/AboutUs.md new file mode 100644 index 00000000000..c78e1f4d66a --- /dev/null +++ b/docs/AboutUs.md @@ -0,0 +1,59 @@ +--- +layout: page +title: About Us +--- + +_{The dummy content given below serves as a placeholder to be used by future forks of the project.}_ + +We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg). + +## Project Team + +### John Doe + + + +[[homepage](http://www.comp.nus.edu.sg/~damithch)] +[[github](https://github.com/damithc)] +[[portfolio](team/johndoe.md)] + +* Role: Project Advisor + +### John Roe + + + +[[github](http://github.com/lejolly)] +[[portfolio](team/johndoe.md)] + +* Role: Team Lead +* Responsibilities: UI + +### Johnny Doe + + + +[[github](http://github.com/yijinl)] [[portfolio](team/johndoe.md)] + +* Role: Developer +* Responsibilities: Data + +### Johnny Roe + + + +[[github](http://github.com/m133225)] +[[portfolio](team/johndoe.md)] + +* Role: Developer +* Responsibilities: Dev Ops + Threading + +### Benson Meier + + + +[[github](http://github.com/yl-coder)] +[[portfolio](team/johndoe.md)] + +* Role: Developer +* Responsibilities: UI diff --git a/docs/ContactUs.adoc b/docs/ContactUs.adoc deleted file mode 100644 index 81be279ef6d..00000000000 --- a/docs/ContactUs.adoc +++ /dev/null @@ -1,7 +0,0 @@ -= Contact Us -:site-section: ContactUs -:stylesDir: stylesheets - -* *Bug reports, Suggestions* : Post in our https://github.com/se-edu/addressbook-level3/issues[issue tracker] if you noticed bugs or have suggestions on how to improve. -* *Contributing* : We welcome pull requests. Follow the process described https://github.com/oss-generic/process[here] -* *Email us* : You can also reach us at `damith [at] comp.nus.edu.sg` diff --git a/docs/DevOps.adoc b/docs/DevOps.adoc deleted file mode 100644 index 2aa5a6bc0c1..00000000000 --- a/docs/DevOps.adoc +++ /dev/null @@ -1,48 +0,0 @@ -= AddressBook Level 3 - Dev Ops -:site-section: DeveloperGuide -:toc: -:toc-title: -:toc-placement: preamble -:sectnums: -:imagesDir: images -:stylesDir: stylesheets -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:warning-caption: :warning: -endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3/tree/master - -== Build Automation - -See <> to learn how to use Gradle for build automation. - -== Continuous Integration - -We use https://travis-ci.org/[Travis CI] and https://www.appveyor.com/[AppVeyor] to perform _Continuous Integration_ on our projects. See <> and <> for more details. - -== Coverage Reporting - -We use https://coveralls.io/[Coveralls] to track the code coverage of our projects. See <> for more details. - -== Documentation Previews - -When a pull request has changes to asciidoc files, you can use https://www.netlify.com/[Netlify] to see a preview of how the HTML version of those asciidoc files will look like when the pull request is merged. See <> for more details. - -== Making a Release - -Here are the steps to create a new release. - -. Update the version number in link:{repoURL}/src/main/java/seedu/address/MainApp.java[`MainApp.java`]. -. Generate a JAR file <>. -. Tag the repo with the version number. e.g. `v0.1` -. https://help.github.com/articles/creating-releases/[Create a new release using GitHub] and upload the JAR file you created. - -== Managing Dependencies - -A project often depends on third-party libraries. For example, Address Book depends on the https://github.com/FasterXML/jackson[Jackson library] for JSON parsing. Managing these _dependencies_ can be automated using Gradle. For example, Gradle can download the dependencies automatically, which is better than these alternatives: - -[loweralpha] -. Include those libraries in the repo (this bloats the repo size) -. Require developers to download those libraries manually (this creates extra work for developers) diff --git a/docs/DevOps.md b/docs/DevOps.md new file mode 100644 index 00000000000..f24946b132a --- /dev/null +++ b/docs/DevOps.md @@ -0,0 +1,30 @@ +--- +layout: page +title: DevOps Guide +--- + +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- + +## Build automation + +This project uses Gradle for **build automation and dependency management**. See [Using Gradle](UsingGradle.md) for more details. + +-------------------------------------------------------------------------------------------------------------------- + +## Continuous integration (CI) + +This project uses GitHub Actions for CI. The project comes with the necessary GitHub Actions configurations files (in the `.github/workflows` folder). No further setting up required. + +-------------------------------------------------------------------------------------------------------------------- + +## Making a release + +Here are the steps to create a new release. + +1. Update the version number in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). +1. Generate a JAR file [Using Gradle](UsingGradle.md#creating-the-jar-file). +1. Tag the repo with the version number. e.g. `v0.1` +1. [Create a new release using GitHub](https://help.github.com/articles/creating-releases/) and upload the JAR file you created. diff --git a/docs/DeveloperGuide.adoc b/docs/DeveloperGuide.adoc deleted file mode 100644 index 3d65905a853..00000000000 --- a/docs/DeveloperGuide.adoc +++ /dev/null @@ -1,425 +0,0 @@ -= AddressBook Level 3 - Developer Guide -:site-section: DeveloperGuide -:toc: -:toc-title: -:toc-placement: preamble -:sectnums: -:imagesDir: images -:stylesDir: stylesheets -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:warning-caption: :warning: -endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3/tree/master - -By: `Team SE-EDU`      Since: `Jun 2016`      Licence: `MIT` - -== Setting up - -Refer to the guide <>. - -== Design - -[[Design-Architecture]] -=== Architecture - -.Architecture Diagram -image::ArchitectureDiagram.png[] - -The *_Architecture Diagram_* given above explains the high-level design of the App. Given below is a quick overview of each component. - -[TIP] -The `.puml` files used to create diagrams in this document can be found in the link:{repoURL}/docs/diagrams/[diagrams] folder. -Refer to the <> to learn how to create and edit diagrams. - -`Main` has two classes called link:{repoURL}/src/main/java/seedu/address/Main.java[`Main`] and link:{repoURL}/src/main/java/seedu/address/MainApp.java[`MainApp`]. It is responsible for, - -* At app launch: Initializes the components in the correct sequence, and connects them up with each other. -* At shut down: Shuts down the components and invokes cleanup method where necessary. - -<> represents a collection of classes used by multiple other components. -The following class plays an important role at the architecture level: - -* `LogsCenter` : Used by many classes to write log messages to the App's log file. - -The rest of the App consists of four components. - -* <>: The UI of the App. -* <>: The command executor. -* <>: Holds the data of the App in-memory. -* <>: Reads data from, and writes data to, the hard disk. - -Each of the four components - -* Defines its _API_ in an `interface` with the same name as the Component. -* Exposes its functionality using a `{Component Name}Manager` class. - -For example, the `Logic` component (see the class diagram given below) defines it's API in the `Logic.java` interface and exposes its functionality using the `LogicManager.java` class. - -.Class Diagram of the Logic Component -image::LogicClassDiagram.png[] - -[discrete] -==== How the architecture components interact with each other - -The _Sequence Diagram_ below shows how the components interact with each other for the scenario where the user issues the command `delete 1`. - -.Component interactions for `delete 1` command -image::ArchitectureSequenceDiagram.png[] - -The sections below give more details of each component. - -[[Design-Ui]] -=== UI component - -.Structure of the UI Component -image::UiClassDiagram.png[] - -*API* : link:{repoURL}/src/main/java/seedu/address/ui/Ui.java[`Ui.java`] - -The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class. - -The `UI` component uses JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow`] is specified in link:{repoURL}/src/main/resources/view/MainWindow.fxml[`MainWindow.fxml`] - -The `UI` component, - -* Executes user commands using the `Logic` component. -* Listens for changes to `Model` data so that the UI can be updated with the modified data. - -[[Design-Logic]] -=== Logic component - -[[fig-LogicClassDiagram]] -.Structure of the Logic Component -image::LogicClassDiagram.png[] - -*API* : -link:{repoURL}/src/main/java/seedu/address/logic/Logic.java[`Logic.java`] - -. `Logic` uses the `AddressBookParser` class to parse the user command. -. This results in a `Command` object which is executed by the `LogicManager`. -. The command execution can affect the `Model` (e.g. adding a person). -. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`. -. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as displaying help to the user. - -Given below is the Sequence Diagram for interactions within the `Logic` component for the `execute("delete 1")` API call. - -.Interactions Inside the Logic Component for the `delete 1` Command -image::DeleteSequenceDiagram.png[] - -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. - -[[Design-Model]] -=== Model component - -.Structure of the Model Component -image::ModelClassDiagram.png[] - -*API* : link:{repoURL}/src/main/java/seedu/address/model/Model.java[`Model.java`] - -The `Model`, - -* stores a `UserPref` object that represents the user's preferences. -* stores the Address Book data. -* exposes an unmodifiable `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. -* does not depend on any of the other three components. - -[NOTE] -As a more OOP model, we can store a `Tag` list in `Address Book`, which `Person` can reference. This would allow `Address Book` to only require one `Tag` object per unique `Tag`, instead of each `Person` needing their own `Tag` object. An example of how such a model may look like is given below. + - + -image:BetterModelClassDiagram.png[] - -[[Design-Storage]] -=== Storage component - -.Structure of the Storage Component -image::StorageClassDiagram.png[] - -*API* : link:{repoURL}/src/main/java/seedu/address/storage/Storage.java[`Storage.java`] - -The `Storage` component, - -* can save `UserPref` objects in json format and read it back. -* can save the Address Book data in json format and read it back. - -[[Design-Commons]] -=== Common classes - -Classes used by multiple components are in the `seedu.addressbook.commons` package. - -== Implementation - -This section describes some noteworthy details on how certain features are implemented. - -// tag::undoredo[] -=== [Proposed] Undo/Redo feature -==== Proposed Implementation - -The undo/redo mechanism is facilitated by `VersionedAddressBook`. -It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. -Additionally, it implements the following operations: - -* `VersionedAddressBook#commit()` -- Saves the current address book state in its history. -* `VersionedAddressBook#undo()` -- Restores the previous address book state from its history. -* `VersionedAddressBook#redo()` -- Restores a previously undone address book state from its history. - -These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. - -Given below is an example usage scenario and how the undo/redo mechanism behaves at each step. - -Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state. - -image::UndoRedoState0.png[] - -Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state. - -image::UndoRedoState1.png[] - -Step 3. The user executes `add n/David ...` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`. - -image::UndoRedoState2.png[] - -[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`. - -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. - -image::UndoRedoState3.png[] - -[NOTE] -If the `currentStatePointer` is at index 0, pointing to the initial address book state, then there are no previous address book 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. - -The following sequence diagram shows how the undo operation works: - -image::UndoSequenceDiagram.png[] - -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. - -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. - -[NOTE] -If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone address book 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. - -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. - -image::UndoRedoState4.png[] - -Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. We designed it this way because it no longer makes sense to redo the `add n/David ...` command. This is the behavior that most modern desktop applications follow. - -image::UndoRedoState5.png[] - -The following activity diagram summarizes what happens when a user executes a new command: - -image::CommitActivityDiagram.png[] - -==== Design Considerations - -===== Aspect: How undo & redo executes - -* **Alternative 1 (current choice):** Saves the entire address book. -** Pros: Easy to implement. -** Cons: May have performance issues in terms of memory usage. -* **Alternative 2:** Individual command knows how to undo/redo by itself. -** Pros: Will use less memory (e.g. for `delete`, just save the person being deleted). -** Cons: We must ensure that the implementation of each individual command are correct. - -===== Aspect: Data structure to support the undo/redo commands - -* **Alternative 1 (current choice):** Use a list to store the history of address book states. -** Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project. -** Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both `HistoryManager` and `VersionedAddressBook`. -* **Alternative 2:** Use `HistoryManager` for undo/redo -** Pros: We do not need to maintain a separate list, and just reuse what is already in the codebase. -** Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as `HistoryManager` now needs to do two different things. -// end::undoredo[] - -// tag::dataencryption[] -=== [Proposed] Data Encryption - -_{Explain here how the data encryption feature will be implemented}_ - -// end::dataencryption[] - -=== Logging - -We are using `java.util.logging` package for logging. The `LogsCenter` class is used to manage the logging levels and logging destinations. - -* The logging level can be controlled using the `logLevel` setting in the configuration file (See <>) -* The `Logger` for a class can be obtained using `LogsCenter.getLogger(Class)` which will log messages according to the specified logging level -* Currently log messages are output through: `Console` and to a `.log` file. - -*Logging Levels* - -* `SEVERE` : Critical problem detected which may possibly cause the termination of the application -* `WARNING` : Can continue, but with caution -* `INFO` : Information showing the noteworthy actions by the App -* `FINE` : Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size - -[[Implementation-Configuration]] -=== Configuration - -Certain properties of the application can be controlled (e.g user prefs file location, logging level) through the configuration file (default: `config.json`). - -== Documentation - -Refer to the guide <>. - -== Testing - -Refer to the guide <>. - -== Dev Ops - -Refer to the guide <>. - -[appendix] -== Product Scope - -*Target user profile*: - -* has a need to manage a significant number of contacts -* prefer desktop apps over other types -* can type fast -* prefers typing over mouse input -* is reasonably comfortable using CLI apps - -*Value proposition*: manage contacts faster than a typical mouse/GUI driven app - -[appendix] -== User Stories - -Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (unlikely to have) - `*` - -[width="59%",cols="22%,<23%,<25%,<30%",options="header",] -|======================================================================= -|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 <> by default |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}_ - -[appendix] -== Use Cases - -(For all use cases below, the *System* is the `AddressBook` and the *Actor* is the `user`, unless specified otherwise) - -[discrete] -=== Use case: Delete person - -*MSS* - -1. User requests to list persons -2. AddressBook shows a list of persons -3. User requests to delete a specific person in the list -4. AddressBook deletes the person -+ -Use case ends. - -*Extensions* - -[none] -* 2a. The list is empty. -+ -Use case ends. - -* 3a. The given index is invalid. -+ -[none] -** 3a1. AddressBook shows an error message. -+ -Use case resumes at step 2. - -_{More to be added}_ - -[appendix] -== Non Functional Requirements - -. Should work on any <> as long as it has Java `11` or above installed. -. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage. -. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. - -_{More to be added}_ - -[appendix] -== Glossary - -[[mainstream-os]] Mainstream OS:: -Windows, Linux, Unix, OS-X - -[[private-contact-detail]] Private contact detail:: -A contact detail that is not meant to be shared with others - -[appendix] -== Product Survey - -*Product Name* - -Author: ... - -Pros: - -* ... -* ... - -Cons: - -* ... -* ... - -[appendix] -== Instructions for Manual Testing - -Given below are instructions to test the app manually. - -[NOTE] -These instructions only provide a starting point for testers to work on; testers are expected to do more _exploratory_ testing. - -=== Launch and Shutdown - -. Initial launch - -.. Download the jar file and copy into an empty folder -.. Double-click the jar file + - Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum. - -. Saving window preferences - -.. Resize the window to an optimum size. Move the window to a different location. Close the window. -.. Re-launch the app by double-clicking the jar file. + - Expected: The most recent window size and location is retained. - -_{ more test cases ... }_ - -=== Deleting a person - -. Deleting a person while all persons are listed - -.. Prerequisites: List all persons using the `list` command. Multiple persons in the list. -.. Test case: `delete 1` + - Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated. -.. Test case: `delete 0` + - Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. -.. Other incorrect delete commands to try: `delete`, `delete x` (where x is larger than the list size) _{give more}_ + - Expected: Similar to previous. - -_{ more test cases ... }_ - -=== Saving data - -. Dealing with missing/corrupted data files - -.. _{explain how to simulate a missing/corrupted file and the expected behavior}_ - -_{ more test cases ... }_ diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md new file mode 100644 index 00000000000..42342df73f2 --- /dev/null +++ b/docs/DeveloperGuide.md @@ -0,0 +1,375 @@ +--- +layout: page +title: Developer Guide +--- +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- + +## **Setting up, getting started** + +Refer to the guide [_Setting up and getting started_](SettingUp.md). + +-------------------------------------------------------------------------------------------------------------------- + +## **Design** + +### Architecture + +![Architecture Diagram](images/ArchitectureDiagram.png) + +The ***Architecture Diagram*** given above explains the high-level design of the App. Given below is a quick overview of each component. + +
+ +: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 [Using PlantUML](UsingPlantUml.md) guide to learn how to create and edit diagrams. + +
+ +**`Main`** has two classes called [`Main`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). It is responsible for, +* At app launch: Initializes the components in the correct sequence, and connects them up with each other. +* At shut down: Shuts down the components and invokes cleanup methods where necessary. + +[**`Commons`**](#common-classes) represents a collection of classes used by multiple other components. + +The rest of the App consists of four components. + +* [**`UI`**](#ui-component): The UI of the App. +* [**`Logic`**](#logic-component): The command executor. +* [**`Model`**](#model-component): Holds the data of the App in memory. +* [**`Storage`**](#storage-component): Reads data from, and writes data to, the hard disk. + +Each of the four components, + +* defines its *API* in an `interface` with the same name as the Component. +* exposes its functionality using a concrete `{Component Name}Manager` class (which implements the corresponding API `interface` mentioned in the previous point. + +For example, the `Logic` component (see the class diagram given below) defines its API in the `Logic.java` interface and exposes its functionality using the `LogicManager.java` class which implements the `Logic` interface. + +![Class Diagram of the Logic Component](images/LogicClassDiagram.png) + +**How the architecture components interact with each other** + +The *Sequence Diagram* below shows how the components interact with each other for the scenario where the user issues the command `delete 1`. + +![Component interactions for `delete 1` command](images/ArchitectureSequenceDiagram.png) + +The sections below give more details of each component. + +### UI component + +![Structure of the UI Component](images/UiClassDiagram.png) + +**API** : +[`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java) + +The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class. + +The `UI` component uses JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) + +The `UI` component, + +* Executes user commands using the `Logic` component. +* Listens for changes to `Model` data so that the UI can be updated with the modified data. + +### Logic component + +![Structure of the Logic Component](images/LogicClassDiagram.png) + +**API** : +[`Logic.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/logic/Logic.java) + +1. `Logic` uses the `AddressBookParser` class to parse the user command. +1. This results in a `Command` object which is executed by the `LogicManager`. +1. The command execution can affect the `Model` (e.g. adding a person). +1. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`. +1. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as displaying help to the user. + +Given below is the Sequence Diagram for interactions within the `Logic` component for the `execute("delete 1")` API call. + +![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png) + +
: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. +
+ +### Model component + +![Structure of the Model Component](images/ModelClassDiagram.png) + +**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java) + +The `Model`, + +* stores a `UserPref` object that represents the user’s preferences. +* stores the address book data. +* exposes an unmodifiable `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. +* does not depend on any of the other three components. + + +
: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` object.
+![BetterModelClassDiagram](images/BetterModelClassDiagram.png) + +
+ + +### Storage component + +![Structure of the Storage Component](images/StorageClassDiagram.png) + +**API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java) + +The `Storage` component, +* can save `UserPref` objects in json format and read it back. +* can save the address book data in json format and read it back. + +### Common classes + +Classes used by multiple components are in the `seedu.addressbook.commons` package. + +-------------------------------------------------------------------------------------------------------------------- + +## **Implementation** + +This section describes some noteworthy details on how certain features are implemented. + +### \[Proposed\] Undo/Redo feature + +#### Proposed Implementation + +The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the following operations: + +* `VersionedAddressBook#commit()` — Saves the current address book state in its history. +* `VersionedAddressBook#undo()` — Restores the previous address book state from its history. +* `VersionedAddressBook#redo()` — Restores a previously undone address book state from its history. + +These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. + +Given below is an example usage scenario and how the undo/redo mechanism behaves at each step. + +Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state. + +![UndoRedoState0](images/UndoRedoState0.png) + +Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state. + +![UndoRedoState1](images/UndoRedoState1.png) + +Step 3. The user executes `add n/David …​` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`. + +![UndoRedoState2](images/UndoRedoState2.png) + +
: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`. + +
+ +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) + +
: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 +than attempting to perform the undo. + +
+ +The following sequence diagram shows how the undo operation works: + +![UndoSequenceDiagram](images/UndoSequenceDiagram.png) + +
: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. + +
+ +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. + +
: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. + +
+ +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. + +![UndoRedoState4](images/UndoRedoState4.png) + +Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. Reason: It no longer makes sense to redo the `add n/David …​` command. This is the behavior that most modern desktop applications follow. + +![UndoRedoState5](images/UndoRedoState5.png) + +The following activity diagram summarizes what happens when a user executes a new command: + +![CommitActivityDiagram](images/CommitActivityDiagram.png) + +#### Design consideration: + +##### Aspect: How undo & redo executes + +* **Alternative 1 (current choice):** Saves the entire address book. + * Pros: Easy to implement. + * Cons: May have performance issues in terms of memory usage. + +* **Alternative 2:** Individual command knows how to undo/redo by + itself. + * Pros: Will use less memory (e.g. for `delete`, just save the person being deleted). + * Cons: We must ensure that the implementation of each individual command are correct. + +_{more aspects and alternatives to be added}_ + +### \[Proposed\] Data archiving + +_{Explain here how the data archiving feature will be implemented}_ + +### Logging + +We are using `java.util.logging` package for logging. The `LogsCenter` +class is used to manage the logging levels and logging destinations. + +* The logging level can be controlled using the `logLevel` setting in the configuration file (See the [Configuration](#configuration) section). +* The `Logger` for a class can be obtained using `LogsCenter.getLogger(Class)` which will log messages according to the specified logging level. +* Log messages are output through: `Console` and to a `.log` file. + +**Logging Levels** + +* `SEVERE`: A critical problem detected which may cause the termination of the application. +* `WARNING`: Can continue, but with caution. +* `INFO`: Information showing the noteworthy actions by the App. +* `FINE`: Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size. + +### Configuration + +Certain properties of the application can be controlled (e.g user prefs file location, logging level) through the configuration file (default: `config.json`). + +-------------------------------------------------------------------------------------------------------------------- + +## **Documentation, testing, dev ops** + +* [Documentation Guide](Documentation.md) + * Related: [Using PlantUML](UsingPlantUml.md), [Using Netlify](UsingNetlify.md) +* [Testing Guide](Testing.md) +* [Dev Ops Guide](DevOps.md) + * Related: [Using Gradle](UsingGradle.md) + +-------------------------------------------------------------------------------------------------------------------- + +## **Appendix: Requirements** + +### Product scope + +**Target user profile**: + +* has a need to manage a significant number of contacts +* prefer desktop apps over other types +* can type fast +* prefers typing over mouse input +* is reasonably comfortable using CLI apps + +**Value proposition**: manage contacts faster than a typical mouse/GUI driven app + + +### User Stories + +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 | + +*{More to be added}* + +### Use Cases + +(For all use cases below, the **System** is the `AddressBook` and the **Actor** is the `user`, unless specified otherwise) + +**Use case: Delete a person** + +**MSS** + +1. User requests to list persons +2. AddressBook shows a list of persons +3. User requests to delete a specific person in the list +4. AddressBook deletes the person + + Use case ends. + +**Extensions** + +* 2a. The list is empty. + + Use case ends. + +* 3a. The given index is invalid. + + * 3a1. AddressBook shows an error message. + + Use case resumes at step 2. + +*{More to be added}* + +### Non-Functional Requirements + +1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed. +2. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage. +3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. + +*{More to be added}* + +### Glossary + +* **Mainstream OS**: Windows, Linux, Unix, OS-X +* **Private contact detail**: A contact detail that is not meant to be shared with others + +-------------------------------------------------------------------------------------------------------------------- + +## **Appendix: Instructions for manual testing** + +Given below are instructions to test the app manually. + +
:information_source: **Note:** These instructions only provide a starting point for testers to work on; +testers are expected to do more *exploratory* testing. + +
+ +### Launch and shutdown + +1. Initial launch + + 1. Download the jar file and copy into an empty folder + + 1. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum. + +1. Saving window preferences + + 1. Resize the window to an optimum size. Move the window to a different location. Close the window. + + 1. Re-launch the app by double-clicking the jar file.
+ Expected: The most recent window size and location is retained. + +1. _{ more test cases …​ }_ + +### Deleting a person + +1. Deleting a person while all persons are being shown + + 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. + + 1. Test case: `delete 1`
+ Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated. + + 1. Test case: `delete 0`
+ Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. + + 1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
+ Expected: Similar to previous. + +1. _{ more test cases …​ }_ + +### Saving data + +1. Dealing with missing/corrupted data files + + 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ + +1. _{ more test cases …​ }_ diff --git a/docs/Documentation.adoc b/docs/Documentation.adoc deleted file mode 100644 index ad90ac87bda..00000000000 --- a/docs/Documentation.adoc +++ /dev/null @@ -1,123 +0,0 @@ -= AddressBook Level 3 - Documentation -:site-section: DeveloperGuide -:toc: -:toc-title: -:toc-placement: preamble -:sectnums: -:imagesDir: images -:stylesDir: stylesheets -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:warning-caption: :warning: -endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3/tree/master - -== Introduction - -We use asciidoc for writing documentation. - -[NOTE] -We chose asciidoc over Markdown because asciidoc, although a bit more complex than Markdown, provides more flexibility in formatting. - -== Editing Documentation - -See <> to learn how to render `.adoc` files locally to preview the end result of your edits. -Alternatively, you can download the AsciiDoc plugin for IntelliJ, which allows you to preview the changes you have made to your `.adoc` files in real-time. - -== Editing Diagrams - -See <> to find out how to create and update the UML diagrams in the developer guide. - -== Publishing Documentation - -See <> to learn how to deploy GitHub Pages using Travis. - -== Converting Documentation to PDF format - -We use https://www.google.com/chrome/browser/desktop/[Google Chrome] for converting documentation to PDF format, as Chrome's PDF engine preserves hyperlinks used in webpages. - -Here are the steps to convert the project documentation files to PDF format. - -. Follow the instructions in <> to convert the AsciiDoc files in the `docs/` directory to HTML format. -. Go to your generated HTML files in the `build/docs` folder, right click on them and select `Open with` -> `Google Chrome`. -. Within Chrome, click on the `Print` option in Chrome's menu. -. Set the destination to `Save as PDF`, then click `Save` to save a copy of the file in PDF format. For best results, use the settings indicated in the screenshot below. - -.Saving documentation as PDF files in Chrome -image::chrome_save_as_pdf.png[width="300"] - -[[Docs-SiteWideDocSettings]] -== Site-wide Documentation Settings - -The link:{repoURL}/build.gradle[`build.gradle`] file specifies some project-specific https://asciidoctor.org/docs/user-manual/#attributes[asciidoc attributes] which affects how all documentation files within this project are rendered. - -[TIP] -Attributes left unset in the `build.gradle` file will use their *default value*, if any. - -[cols="1,2a,1", options="header"] -.List of site-wide attributes -|=== -|Attribute name |Description |Default value - -|`site-name` -|The name of the website. -If set, the name will be displayed near the top of the page. -|_not set_ - -|`site-githuburl` -|URL to the site's repository on https://github.com[GitHub]. -Setting this will add a "View on GitHub" link in the navigation bar. -|_not set_ - -|`site-seedu` -|Define this attribute if the project is an official SE-EDU project. -This will render the SE-EDU navigation bar at the top of the page, and add some SE-EDU-specific navigation items. -|_not set_ - -|=== - -[[Docs-PerFileDocSettings]] -== Per-file Documentation Settings - -Each `.adoc` file may also specify some file-specific https://asciidoctor.org/docs/user-manual/#attributes[asciidoc attributes] which affects how the file is rendered. - -Asciidoctor's https://asciidoctor.org/docs/user-manual/#builtin-attributes[built-in attributes] may be specified and used as well. - -[TIP] -Attributes left unset in `.adoc` files will use their *default value*, if any. - -[cols="1,2a,1", options="header"] -.List of per-file attributes, excluding Asciidoctor's built-in attributes -|=== -|Attribute name |Description |Default value - -|`site-section` -|Site section that the document belongs to. -This will cause the associated item in the navigation bar to be highlighted. -One of: `UserGuide`, `DeveloperGuide`, ``LearningOutcomes``{asterisk}, `AboutUs`, `ContactUs` - -_{asterisk} Official SE-EDU projects only_ -|_not set_ - -|`no-site-header` -|Set this attribute to remove the site navigation bar. -|_not set_ - -|=== - -== Site Template - -The files in link:{repoURL}/docs/stylesheets[`docs/stylesheets`] are the https://developer.mozilla.org/en-US/docs/Web/CSS[CSS stylesheets] of the site. -You can modify them to change some properties of the site's design. - -The files in link:{repoURL}/docs/templates[`docs/templates`] controls the rendering of `.adoc` files into HTML5. -These template files are written in a mixture of https://www.ruby-lang.org[Ruby] and http://slim-lang.com[Slim]. - -[WARNING] -==== -Modifying the template files in link:{repoURL}/docs/templates[`docs/templates`] requires some knowledge and experience with Ruby and Asciidoctor's API. -You should only modify them if you need greater control over the site's layout than what stylesheets can provide. -The SE-EDU team does not provide support for modified template files. -==== diff --git a/docs/Documentation.md b/docs/Documentation.md new file mode 100644 index 00000000000..7937be91991 --- /dev/null +++ b/docs/Documentation.md @@ -0,0 +1,72 @@ +--- +layout: page +title: Documentation +--- + +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- + +## Style guidance + +Follow the [**Google developer documentation style guide**](https://developers.google.com/style). + +-------------------------------------------------------------------------------------------------------------------- + +## Publishing documentation + +We use [**Jekyll**](https://jekyllrb.com/) to manage documentation. As GitHub has native support for Jekyll, it can convert your documentation into HTML and deploy it on the `githhub.io` URL of your project. + +Do the following to set up the GitHub pages website of your project: +1. Go to your repo's `settings` tab. +1. Scroll down to the `GitHub Pages` section. +1. Set the `Source` to `master branch /docs folder`. + +-------------------------------------------------------------------------------------------------------------------- + +## Updating contents + +Jekyll uses [**kramdown**](https://kramdown.gettalong.org/syntax.html) (a superset of Markdown) for writing content. You can use Intellij (or any other text editor) to update the relevant `.md` files. + +
:bulb: **Recommendation:** Limit your content to Markdown and GFMD syntax only i.e., avoid kramdown-specific syntax that are not compatible with Markdown/GFMD + +
+ +* **Editing diagrams**: See [Using PlantUml](UsingPlantUml.md) to find out how to create and update the UML diagrams in the developer guide. +* **Previewing changes locally**: There are several ways to preview changes locally. + * **Option 1 -- Intellij preview**: Intellij supports previewing Markdown files, as explained [here](https://www.jetbrains.com/help/idea/markdown.html). While the preview shown by Intellij is somewhat rudimentary, it is good enough for most cases. + * **Option 2 -- Run Jekyll locally**: You can [set up Jekyll locally and run it](https://help.github.com/en/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll) to see the exact way the update affects the final outcome. +* **Previewing changes on GitHub**: + * **Option 1 -- Github preview**: You can see a basic preview of the page by navigating to the corresponding `.md` source file in GitHub. + * **Option 2 -- Use Netlify PR preview**: You can [set up Netlify to show previews of PRs](UsingNetlify.md). This method shows a preview of the exact way the update affects the final outcome. However, note that Netlify has a limit on monthly build minutes, likely insufficient for an active project. + +-------------------------------------------------------------------------------------------------------------------- + +## Site-wide documentation settings +The `_config.yml` file specifies some project-specific attributes which affect all the documentation within this project. + +|Attribute|Description| +|---------|-----------| +|`title`|The title of your site, usually the name of your project.| + +The files in `docs/_include` and `docs/_layouts` control the template of the pages; the files in `docs/_sass` control the style of the pages. + +
:warning: **Warning:** + +Modifying these files requires some knowledge and experience with Jekyll. You should only modify them if you need greater control over the site’s layout. The SE-EDU team does not provide support for modified template files. +
+ +-------------------------------------------------------------------------------------------------------------------- + +## Converting a document to the PDF format + +**Use [Google Chrome](https://www.google.com/chrome/browser/desktop/) (:exclamation: NOT any other Browser)** for converting documentation to PDF format. Reason: Chrome’s PDF engine preserves hyperlinks used in Web pages. + +Here are the steps to convert the project documentation files to PDF format. +1. Go to your generated documentation site on GitHub using Chrome. +1. Within Chrome, click on the `Print` option in Chrome’s menu. +1. Set the destination to `Save as PDF`, then click `Save` to save a copy of the file in PDF format. For best results, use the settings indicated in the screenshot below. + +![Saving documentation as PDF files in Chrome](images/chrome_save_as_pdf.png) + diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 00000000000..bf0110f33cb --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +gem 'jekyll' +gem 'github-pages', group: :jekyll_plugins +gem 'wdm', '~> 0.1.0' if Gem.win_platform? \ No newline at end of file diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock new file mode 100644 index 00000000000..4caff5b900c --- /dev/null +++ b/docs/Gemfile.lock @@ -0,0 +1,251 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (6.0.3.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.11.1) + colorator (1.1.0) + commonmarker (0.17.13) + ruby-enum (~> 0.5) + concurrent-ruby (1.1.6) + dnsruby (1.61.3) + addressable (~> 2.5) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + ethon (0.12.0) + ffi (>= 1.3.0) + eventmachine (1.2.7-x64-mingw32) + execjs (2.7.0) + faraday (1.0.1) + multipart-post (>= 1.2, < 3) + ffi (1.12.2-x64-mingw32) + forwardable-extended (2.6.0) + gemoji (3.0.1) + github-pages (204) + github-pages-health-check (= 1.16.1) + jekyll (= 3.8.5) + jekyll-avatar (= 0.7.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.1.6) + jekyll-default-layout (= 0.1.4) + jekyll-feed (= 0.13.0) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.13.0) + jekyll-mentions (= 1.5.1) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.15.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.1) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.6.1) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.1.1) + jekyll-theme-cayman (= 0.1.1) + jekyll-theme-dinky (= 0.1.1) + jekyll-theme-hacker (= 0.1.1) + jekyll-theme-leap-day (= 0.1.1) + jekyll-theme-merlot (= 0.1.1) + jekyll-theme-midnight (= 0.1.1) + jekyll-theme-minimal (= 0.1.1) + jekyll-theme-modernist (= 0.1.1) + jekyll-theme-primer (= 0.5.4) + jekyll-theme-slate (= 0.1.1) + jekyll-theme-tactile (= 0.1.1) + jekyll-theme-time-machine (= 0.1.1) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.11.1) + kramdown (= 1.17.0) + liquid (= 4.0.3) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.10.4, < 2.0) + rouge (= 3.13.0) + terminal-table (~> 1.4) + github-pages-health-check (1.16.1) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (~> 4.0) + public_suffix (~> 3.0) + typhoeus (~> 1.3) + html-pipeline (2.12.3) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.8.5) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-avatar (0.7.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.1.1) + coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.3.1) + commonmarker (~> 0.14) + jekyll (>= 3.7, < 5.0) + jekyll-commonmark-ghpages (0.1.6) + commonmarker (~> 0.17.6) + jekyll-commonmark (~> 1.2) + rouge (>= 2.0, < 4.0) + jekyll-default-layout (0.1.4) + jekyll (~> 3.0) + jekyll-feed (0.13.0) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) + octokit (~> 4.0, != 4.4.0) + jekyll-mentions (1.5.1) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.15.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.1) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + rubyzip (>= 1.3.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.5.4) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.11.1) + gemoji (~> 3.0) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + kramdown (1.17.0) + liquid (4.0.3) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + mini_portile2 (2.4.0) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.14.1) + multipart-post (2.1.1) + nokogiri (1.10.9-x64-mingw32) + mini_portile2 (~> 2.4.0) + octokit (4.18.0) + faraday (>= 0.9) + sawyer (~> 0.8.0, >= 0.5.3) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (3.1.1) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) + rouge (3.13.0) + ruby-enum (0.8.0) + i18n + rubyzip (2.3.0) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.7) + thread_safe (~> 0.1) + unicode-display_width (1.7.0) + wdm (0.1.1) + zeitwerk (2.3.0) + +PLATFORMS + x64-mingw32 + +DEPENDENCIES + github-pages + jekyll + wdm (~> 0.1.0) + +BUNDLED WITH + 2.1.4 diff --git a/docs/LearningOutcomes.adoc b/docs/LearningOutcomes.adoc deleted file mode 100644 index 436c1777617..00000000000 --- a/docs/LearningOutcomes.adoc +++ /dev/null @@ -1,216 +0,0 @@ -= Learning Outcomes -:site-section: LearningOutcomes -:toc: macro -:toc-title: -:toclevels: 1 -:imagesDir: images -:stylesDir: stylesheets -ifdef::env-github[] -:note-caption: :information_source: -endif::[] - -After studying this code and completing the corresponding exercises, you should be able to, - -toc::[] - -== Utilize User Stories `[LO-UserStories]` - -=== References - -* https://se-edu.github.io/se-book/specifyingRequirements/userStories/[se-edu/se-book: Requirements: Specifying Requirements: User Stories] - -=== Exercise: Add more user stories - -* Assume you are planing to expand the functionality of the AddressBook (but keep it as a CLI application). -What other user stories do you think AddressBook should support? Add those user stories to the `DeveloperGuide.adoc`. - -== Utilize use cases `[LO-UseCases]` - -=== References - -* https://se-edu.github.io/se-book/specifyingRequirements/useCases/[se-edu/se-book: Requirements: Specifying Requirements: Use Cases] - -=== Exercise: Add a 'Rename tag' use case - -* Add a use case to the `DeveloperGuide.adoc` to cover the case of _renaming of an existing tag_. -e.g. rename the tag `friends` to `buddies` (i.e. all persons who had the `friends` tag will now have -a `buddies` tag instead) -Assume that AddressBook confirms the change with the user before carrying out the operation. - -== Use Non Functional Requirements `[LO-NFR]` - -=== References - -* https://se-edu.github.io/se-book/requirements/nonFunctionalRequirements/[se-edu/se-book: Requirements: Non-Functional Requirements] - -=== Exercise: Add more NFRs - -* Add some more NFRs to the `DeveloperGuide.adoc` - -== Use Polymorphism `[LO-Polymorphism]` - -Note how the `Command::execute()` method shows polymorphic behavior. - -=== References - -* https://se-edu.github.io/se-book/oop/polymorphism/[se-edu/se-book: Paradigms: OOP: Polymorphism] -* https://se-edu.github.io/se-book/cppToJava/inheritance/polymorphism/[se-edu/se-book: C++ to Java: OOP: Polymorphism] - -=== Exercise: Add a polymorphic `isMutating` method - -* Add a method `boolean isMutating()` to the `Command` class. This method will return `true` for -command types that mutate the data. e.g. `AddCommand` -* Currently, AddressBook data are saved to the file after every command. -Take advantage of the the new method you added to limit file saving to only for command types that mutate data. -i.e. `add` command should always save the data while `list` command should never save data to the file. - -[NOTE] -==== -There may be better ways to limit file saving to commands that mutate data. The above approach, while not -optimal, will give you chance to implement a polymorphic behavior. -==== - -== Use abstract classes/methods `[LO-Abstract]` - -=== References - -* https://se-edu.github.io/se-book/oop/inheritance/abstractClasses/[se-edu/se-book: Paradigms: OOP: Abstract Classes] -* https://se-edu.github.io/se-book/cppToJava/inheritance/abstractClassesAndMethods/[se-edu/se-book: C++ to Java: OOP: Abstract Classes] - -=== Exercise: Make `Command#execute()` method abstract - -* Make the `Command#execute()` method abstract (hint: refer to the comment given below the method) - -== Use interfaces `[LO-Interfaces]` - -Note how the `AddressBook` class implements the `ReadOnlyAddressBook` interface so that clients who don't need write access to the `AddressBook` can access the `AddressBook` through the `ReadOnlyAddressBook` interface instead. - -image::ReadOnlyAddressBookUsage.png[width=500] - -=== References - -* https://se-edu.github.io/se-book/oop/inheritance/interfaces/[se-edu/se-book: Paradigms: OOP: Abstract Interfaces] -* https://se-edu.github.io/se-book/cppToJava/inheritance/interfaces/[se-edu/se-book: C++ to Java: OOP: Abstract Interfaces] - -=== Exercise: Add a `Printable` interface - -* Add a `Printable` interface as follows. -+ -image::PrintableInterface.png[width=400] -* `Override` the `getPrintableString` in classes `Name`, `Phone`, `Email`, and `Address` so that each produces a printable string representation of the object. e.g. `Name: John Smith`, `Phone: 12349862` -* Add the following method in a suitable place of some other class. Note how the method depends on the Interface. -+ -[source,java] ----- -/** - * Returns a concatenated version of the printable strings of each object. - */ -String getPrintableString(Printable... printables) { ----- -+ -The above method can be used to get a printable string representing a bunch of person details. -For example, you should be able to call that method like this: -+ -[source,java] ----- -// p is a Person object -return getPrintableString(p.getPhone(), p.getEmail(), p.getAddress()); ----- - -== Follow Liskov Substitution Principle `[LO-LSP]` - -=== References - -* https://se-edu.github.io/se-book/principles/liskovSubstitutionPrinciple/[se-edu/se-book: Principles: Liskov Substitution Principle] - -=== Exercise: Add an exception to an overridden method - -* Add a `throws Exception` clause to the `AddCommand::execute` method. Notice how Java compiler will not allow it, -unless you add the same `throws` clause to the parent class method. This is because if a child class throws -an exception that is not specified by the Parent's contract, the child class is no longer substitutable in place of -the parent class. -* Also note that while in the above example the compiler enforces LSP, there are other situations where it is up to -the programmer to enforce it. For example, if the method in the parent class works for `null` input, the overridden -method in the child class should not reject `null` inputs. This will not be enforced by the compiler. - -== Use Java-FX for GUI programming `[LO-JavaFx]` - -=== References - -* https://se-edu.github.io/se-book/javaTools/javaFXBasic/[se-edu/se-book: Tools: Java: JavaFX: Basic] - -=== Exercise: Enhance GUI - -* Do some enhancements to the AddressBook GUI. e.g. add an application icon, change font size/style - -== Analyze Coupling and Cohesion of designs `[LO-CouplingCohesion]` - -* Notice how having a separate `ParserUtil` class to handle user input validation, space trimming etc. of model data (an application of the Single Responsibility Principle) improves the _cohesion_ of the model component (since it does not need to be concerned with handling user input) as well as the `ParserUtil` class. - -=== References - -* https://se-edu.github.io/se-book/designFundamentals/coupling/[se-edu/se-book: Design: Design Principles: Coupling] -* https://se-edu.github.io/se-book/designFundamentals/cohesion/[se-edu/se-book: Design: Design Principles: Cohesion] - -=== Exercise: Identify places to reduce coupling and increase cohesion - -* Where else in the design coupling can be reduced further, or cohesion can be increased further? - -[[apply-dependency-inversion-principle-lo-dip]] -== Apply Dependency Inversion Principle `[LO-DIP]` - -* Note how the `LogicManager` class doesn't depend on `StorageManager` directly, but rather the interface `Storage`. -This is an application of the Dependency Inversion Principle. -+ -image::LogicStorageDIP.png[width=300] -* Where else in the code do you notice the application of DIP? - -=== References - -* https://se-edu.github.io/se-book/principles/dependencyInversionPrinciple/[se-edu/se-book: Principles: Dependency Inversion Principle] - -== Use Dependency Injection `[LO-DI]` - -Notice how the `LogicManager` class does not depend on the `StorageManager` class, but depends on the `Storage` interface. -This allows us to use _Dependency Injection_ to test the `LogicManager` class without getting the `StorageManager` class involved. - -=== References - -* https://se-edu.github.io/se-book/testing/dependencyInjection/[se-edu/se-book: Quality Assurance: Testing: Dependency Injection] - -=== Exercise: Facilitate injecting a StorageStub - -* Notice how `LogicManagerTest` tests `LogicManager` by constructing a `StorageManager` object. -* Implement `StorageStub` such that calls to its `save*` methods do nothing (i.e. empty method body). -* Update `LogicManagerTest` to work with the `StorageStub` instead of the actual `StorageManager` object. -i.e. `LogicManagerTest` injects a `StorageStub` object when constructing a `LogicManager` before testing it. -+ -image::DependencyInjection.png[width=600] -* The example above uses <> as a means to achieve DI. -Note that there is another way to inject a `StorageStub` object, as shown below. -In this case we do not apply the DIP but we still achieve DI. -+ -image::DependencyInjectionWithoutDIP.png[width=250] - -== Apply Open-Closed Principle `[LO-OCP]` - -=== References - -* https://se-edu.github.io/se-book/principles/openClosedPrinciple/[se-edu/se-book: Principles: Open-Closed Principle] - -=== Exercise: Analyze OCP-compliance of the `LogicManager` class - -* Consider adding a new command to the Address Book. e.g. an `edit` command. Notice how little you need to change in the `LogicManager` class to extend its behavior so that it can execute the new command. -That is because `LogicManager` follows the OCP i.e. `LogicManager` is _open to be extended_ with more commands but _closed for modifications_. -* Is it possible to make the `AddressBookParser` class more OCP-compliant in terms of extending it to handle more -command types? -* In terms of how it saves data, is `LogicManager` more OCP-compliant -due to the application of DIP as given in <>? -How can you improve ``LogicManager``'s OCP-compliance further so that it can not only work with different types -of storages, but different number of storages (e.g. save to both a text file and a database). - -== Work in a 3KLoC code base `[LO-3KLoC]` - -=== Exercise: Enhance AddressBook - -* Enhance AddressBook in some way. e.g. add a new command diff --git a/docs/SettingUp.adoc b/docs/SettingUp.adoc deleted file mode 100644 index c0659782fab..00000000000 --- a/docs/SettingUp.adoc +++ /dev/null @@ -1,84 +0,0 @@ -= AddressBook Level 3 - Setting Up -:site-section: DeveloperGuide -:toc: -:toc-title: -:toc-placement: preamble -:sectnums: -:imagesDir: images -:stylesDir: stylesheets -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:warning-caption: :warning: -endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3/tree/master - -== Prerequisites - -. *JDK `11`* or above -. *IntelliJ* IDE -+ -[NOTE] -IntelliJ by default has Gradle and JavaFx plugins installed. + -Do not disable them. If you have disabled them, go to `File` > `Settings` > `Plugins` to re-enable them. - -== Setting up the project in your computer - -. Fork this repo, and clone the fork to your computer -. Open IntelliJ (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project dialog first) -. Set up the correct JDK version for Gradle -.. Click `Configure` > `Project Defaults` > `Project Structure` -.. Click `New...` and find the directory of the JDK -. Click `Import Project` -. Locate the `build.gradle` file and select it. Click `OK` -. Click `Open as Project` -. Click `OK` to accept the default settings. - -== Verifying the setup - -. Run the `seedu.address.Main` and try a few commands -. <> to ensure they all pass. - -== Configurations to do before writing code - -=== Configuring the coding style - -This project follows https://github.com/oss-generic/process/blob/master/docs/CodingStandards.adoc[oss-generic coding standards]. IntelliJ's default style is mostly compliant with ours but it uses a different import order from ours. To rectify, - -. Go to `File` > `Settings...` (Windows/Linux), or `IntelliJ IDEA` > `Preferences...` (macOS) -. Select `Editor` > `Code Style` > `Java` -. Click on the `Imports` tab to set the order - -* For `Class count to use import with '\*'` and `Names count to use static import with '*'`: Set to `999` to prevent IntelliJ from contracting the import statements -* For `Import Layout`: The order is `import static all other imports`, `import java.\*`, `import javax.*`, `import org.\*`, `import com.*`, `import all other imports`. Add a `` between each `import` - -Optionally, you can follow the <> document to configure Intellij to check style-compliance as you write code. - -=== Updating documentation to match your fork - -After forking the repo, the documentation will still have the SE-EDU branding and refer to the `se-edu/addressbook-level3` repo. - -If you plan to develop this fork as a separate product (i.e. instead of contributing to `se-edu/addressbook-level3`), you should do the following: - -. Configure the <> in link:{repoURL}/build.gradle[`build.gradle`], such as the `site-name`, to suit your own project. - -. Replace the URL in the attribute `repoURL` in link:{repoURL}/docs/DeveloperGuide.adoc[`DeveloperGuide.adoc`] and link:{repoURL}/docs/UserGuide.adoc[`UserGuide.adoc`] with the URL of your fork. - -=== Setting up CI - -Set up Travis to perform Continuous Integration (CI) for your fork. See <> to learn how to set it up. - -After setting up Travis, you can optionally set up coverage reporting for your team fork (see <>). - -[NOTE] -Coverage reporting could be useful for a team repository that hosts the final version but it is not that useful for your personal fork. - -Optionally, you can set up AppVeyor as a second CI (see <>). - -[NOTE] -Having both Travis and AppVeyor ensures your App works on both Unix-based platforms and Windows-based platforms (Travis is Unix-based and AppVeyor is Windows-based) - -=== Getting started with coding - -When you are ready to start coding, we recommend that you get some sense of the overall design by reading about <>. diff --git a/docs/SettingUp.md b/docs/SettingUp.md new file mode 100644 index 00000000000..8951332680a --- /dev/null +++ b/docs/SettingUp.md @@ -0,0 +1,84 @@ +--- +layout: page +title: Setting up and getting started +--- + +* Table of Contents +{:toc} + + +-------------------------------------------------------------------------------------------------------------------- + +## Setting up the project in your computer + +1. Ensure you have the following prerequisites: + * **JDK `11`** or above + * **IntelliJ** IDE: IntelliJ by default has Gradle and JavaFx plugins installed. Do not disable them. If you have disabled them, go to `File` \> `Settings` \> `Plugins` to re-enable them. +1. Fork this repo, and clone the fork to your computer. +1. Open IntelliJ (if you are not in the welcome screen, click `File` \> `Close Project` to close the existing project dialog first). +1. Set up the correct JDK version for Gradle. + 1. Click `Configure` \> `Project Defaults` \> `Project Structure` + 1. Click `New…​` and set it to the directory of the JDK. +1. Click `Import Project` (or `Open or Import` in newer version of Intellij). +1. Locate the `build.gradle` file and select it. Click `OK`. +1. Click `Open as Project`. +1. Click `OK` to accept the default settings. +1. To verify the setup, + 1. run the `seedu.address.Main` and try a few commands + 1. [run the tests](Testing.md) to ensure they all pass + +
:exclamation: Caution: + +Before writing code, there are some configurations that you need to do. They are given in the section below. + +
+ +-------------------------------------------------------------------------------------------------------------------- + +## Before writing code + +### Configure the coding style + +This project follows [oss-generic coding standards](https://oss-generic.github.io/process/docs/CodingStandards.html). IntelliJ’s default style is mostly compliant with ours but it uses a different import order from ours. To rectify, + +1. Go to `File` \> `Settings…​` (Windows/Linux), or `IntelliJ IDEA` \> `Preferences…​` (macOS). +1. Select `Editor` \> `Code Style` \> `Java`. +1. Click on the `Imports` tab to set the import order. + * For `Class count to use import with '*'` and `Names count to use static import with '*'`: Set to `999` to prevent IntelliJ from contracting the import statements. + * For `Import Layout`: The order is:
+ `import static all other imports`
+ ``
+ `import java.*`
+ ``
+ `import javax.*`
+ ``
+ `import org.*`
+ ``
+ `import com.*`
+ ``
+ `import all other imports`
+1. Click on the `Wrapping and Braces` tab and un-tick the `Indent 'case' branches` option.
+ ![](images/intellijCodeStyle-switch.png) + + +
:bulb: **Tip:** + +Optionally, you can follow the [Using Checkstyle](UsingCheckstyle.md) document to configure Intellij to check style-compliance as you write code. + +
+ +### Set up CI + +This project comes with a GitHub Actions config files (in `.github/workflows` folder). When GitHub detects those files, it will run the CI for your project automatically at each push to the `master` branch or to any PR. No set up required. + + +### Learn the design + +When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [AddressBook’s architecture](DeveloperGuide.md). + +### Do the tutorials + +These tutorials will help you get acquainted with the codebase. + +* [Tracing Code](tutorials/TracingCode.md) +* [Removing Fields](tutorials/RemovingFields.md) \ No newline at end of file diff --git a/docs/Testing.adoc b/docs/Testing.adoc deleted file mode 100644 index 5767b92912c..00000000000 --- a/docs/Testing.adoc +++ /dev/null @@ -1,52 +0,0 @@ -= AddressBook Level 3 - Testing -:site-section: DeveloperGuide -:toc: -:toc-title: -:toc-placement: preamble -:sectnums: -:imagesDir: images -:stylesDir: stylesheets -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:warning-caption: :warning: -endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3/tree/master - -== Running Tests - -There are two ways to run tests. - -*Method 1: Using IntelliJ JUnit test runner* - -* To run all tests, right-click on the `src/test/java` folder and choose `Run 'All Tests'` -* To run a subset of tests, you can right-click on a test package, test class, or a test and choose `Run 'ABC'` - -*Method 2: Using Gradle* - -* Open a console and run the command `gradlew clean test` (Mac/Linux: `./gradlew clean test`) - -[NOTE] -See <> for more info on how to run tests using Gradle. - -== Types of tests - -We have three types of tests: - -. _Unit tests_ targeting the lowest level methods/classes. + -e.g. `seedu.address.commons.StringUtilTest` -. _Integration tests_ that are checking the integration of multiple code units (those code units are assumed to be working). + -e.g. `seedu.address.storage.StorageManagerTest` -. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together. + -e.g. `seedu.address.logic.LogicManagerTest` - - -== Troubleshooting Testing -**Problem: Keyboard and mouse movements are not simulated on macOS Mojave, resulting in GUI Tests failure.** - -* Reason: From macOS Mojave onwards, applications without `Accessibility` permission cannot simulate certain keyboard and mouse movements. -* Solution: Open `System Preferences`, click `Security and Privacy` -> `Privacy` -> `Accessibility`, and check the box beside `Intellij IDEA`. - -.`Accessibility` permission is granted to `IntelliJ IDEA` -image::testfx-idea-accessibility-permissions.png[width="600"] diff --git a/docs/Testing.md b/docs/Testing.md new file mode 100644 index 00000000000..72a0f73adce --- /dev/null +++ b/docs/Testing.md @@ -0,0 +1,36 @@ +--- +layout: page +title: Testing Guide +--- + +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- + +## Running tests + +There are two ways to run tests. + +* **Method 1: Using IntelliJ JUnit test runner** + * To run all tests, right-click on the `src/test/java` folder and choose `Run 'All Tests'` + * To run a subset of tests, you can right-click on a test package, + test class, or a test and choose `Run 'ABC'` +* **Method 2: Using Gradle** + * Open a console and run the command `gradlew clean test` (Mac/Linux: `./gradlew clean test`) + +
:link: **Link**: See [Using Gradle](UsingGradle.md) for more info on how to run tests using Gradle. +
+ +-------------------------------------------------------------------------------------------------------------------- + +## Types of tests + +This project has three types of tests: + +1. *Unit tests* targeting the lowest level methods/classes.
+ e.g. `seedu.address.commons.StringUtilTest` +1. *Integration tests* that are checking the integration of multiple code units (those code units are assumed to be working).
+ e.g. `seedu.address.storage.StorageManagerTest` +1. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
+ e.g. `seedu.address.logic.LogicManagerTest` \ No newline at end of file diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc deleted file mode 100644 index 4e5d297a19f..00000000000 --- a/docs/UserGuide.adoc +++ /dev/null @@ -1,177 +0,0 @@ -= AddressBook Level 3 - User Guide -:site-section: UserGuide -:toc: -:toc-title: -:toc-placement: preamble -:sectnums: -:imagesDir: images -:stylesDir: stylesheets -:xrefstyle: full -:experimental: -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -endif::[] -:repoURL: https://github.com/se-edu/addressbook-level3 - -By: `Team SE-EDU` Since: `Jun 2016` Licence: `MIT` - -== Introduction - -AddressBook Level 3 (AB3) is for those who *prefer to use a desktop app for managing contacts*. More importantly, AB3 is *optimized for those who prefer to work with a Command Line Interface* (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. Interested? Jump to the <> to get started. Enjoy! - -== Quick Start - -. Ensure you have Java `11` or above installed in your Computer. -. Download the latest `addressbook.jar` link:{repoURL}/releases[here]. -. Copy the file to the folder you want to use as the home folder for your Address Book. -. Double-click the file to start the app. The GUI should appear in a few seconds. -+ -image::Ui.png[width="790"] -+ -. Type the command in the command box and press kbd:[Enter] to execute it. + -e.g. typing *`help`* and pressing kbd:[Enter] will open the help window. -. Some example commands you can try: - -* *`list`* : lists all contacts -* **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : adds a contact named `John Doe` to the Address Book. -* **`delete`**`3` : deletes the 3rd contact shown in the current list -* *`exit`* : exits the app - -. Refer to <> for details of each command. - -[[Features]] -== Features - -==== -*Command Format* - -* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. -* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`. -* Items with `…`​ after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc. -* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable. -==== - -=== Viewing help : `help` - -Format: `help` - -=== Adding a person: `add` - -Adds a person to the address book + -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` - -[TIP] -A person can have any number of tags (including 0) - -Examples: - -* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` -* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal` - -=== Listing all persons : `list` - -Shows a list of all persons in the address book. + -Format: `list` - -=== Editing a person : `edit` - -Edits an existing person in the address book. + -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]...` - -**** -* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index *must be a positive integer* 1, 2, 3, ... -* At least one of the optional fields must be provided. -* Existing values will be updated to the input values. -* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative. -* You can remove all the person's tags by typing `t/` without specifying any tags after it. -**** - -Examples: - -* `edit 1 p/91234567 e/johndoe@example.com` + -Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. -* `edit 2 n/Betsy Crower t/` + -Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. - -=== Locating persons by name: `find` - -Finds persons whose names contain any of the given keywords. + -Format: `find KEYWORD [MORE_KEYWORDS]` - -**** -* The search is case insensitive. e.g `hans` will match `Hans` -* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` -* Only the name is searched. -* Only full words will be matched e.g. `Han` will not match `Hans` -* Persons matching at least one keyword will be returned (i.e. `OR` search). e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` -**** - -Examples: - -* `find John` + -Returns `john` and `John Doe` -* `find Betsy Tim John` + -Returns any person having names `Betsy`, `Tim`, or `John` - -// tag::delete[] -=== Deleting a person : `delete` - -Deletes the specified person from the address book. + -Format: `delete INDEX` - -**** -* Deletes the person at the specified `INDEX`. -* The index refers to the index number shown in the displayed person list. -* The index *must be a positive integer* 1, 2, 3, ... -**** - -Examples: - -* `list` + -`delete 2` + -Deletes the 2nd person in the address book. -* `find Betsy` + -`delete 1` + -Deletes the 1st person in the results of the `find` command. - -// end::delete[] -=== Clearing all entries : `clear` - -Clears all entries from the address book. + -Format: `clear` - -=== Exiting the program : `exit` - -Exits the program. + -Format: `exit` - -=== Saving the data - -Address book data are saved in the hard disk automatically after any command that changes the data. + -There is no need to save manually. - -// tag::dataencryption[] -=== Encrypting data files `[coming in v2.0]` - -_{explain how the user can enable/disable data encryption}_ -// end::dataencryption[] - -== FAQ - -*Q*: How do I transfer my data to another Computer? + -*A*: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Address Book folder. - -== Command Summary - -* *Add* `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` + -e.g. `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague` -* *Clear* : `clear` -* *Delete* : `delete INDEX` + -e.g. `delete 3` -* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` + -e.g. `edit 2 n/James Lee e/jameslee@example.com` -* *Find* : `find KEYWORD [MORE_KEYWORDS]` + -e.g. `find James Jake` -* *List* : `list` -* *Help* : `help` diff --git a/docs/UserGuide.md b/docs/UserGuide.md new file mode 100644 index 00000000000..5d0883ceb55 --- /dev/null +++ b/docs/UserGuide.md @@ -0,0 +1,178 @@ +--- +layout: page +title: User Guide +--- + +AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. + +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- + +## Quick start + +1. Ensure you have Java `11` or above installed in your Computer. + +1. Download the latest `addressbook.jar` from [here](https://github.com/se-edu/addressbook-level3/releases). + +1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook. + +1. Double-click the file to start the app. The GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.
+ ![Ui](images/Ui.png) + +1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.
+ Some example commands you can try: + + * **`list`** : Lists all contacts. + + * **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the Address Book. + + * **`delete`**`3` : Deletes the 3rd contact shown in the current list. + + * **`clear`** : Deletes all contacts. + + * **`exit`** : Exits the app. + +1. Refer to the [Features](#features) below for details of each command. + +-------------------------------------------------------------------------------------------------------------------- + +## Features + +
+ +**:information_source: Notes about the command format:**
+ +* Words in `UPPER_CASE` are the parameters to be supplied by the user.
+ e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. + +* Items in square brackets are optional.
+ e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`. + +* Items with `…`​ after them can be used multiple times including zero times.
+ e.g. `[t/TAG]…​` can be used as ` ` (i.e. 0 times), `t/friend`, `t/friend t/family` etc. + +* Parameters can be in any order.
+ e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable. + +
+ +### Viewing help : `help` + +Shows a message explaning how to access the help page. + +![help message](images/helpMessage.png) + +Format: `help` + + +### Adding a person: `add` + +Adds a person to the address book. + +Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​` + +
:bulb: **Tip:** +A person can have any number of tags (including 0) +
+ +Examples: +* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` +* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal` + +### Listing all persons : `list` + +Shows a list of all persons in the address book. + +Format: `list` + +### Editing a person : `edit` + +Edits an existing person in the address book. + +Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​` + +* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index **must be a positive integer** 1, 2, 3, …​ +* At least one of the optional fields must be provided. +* Existing values will be updated to the input values. +* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative. +* You can remove all the person’s tags by typing `t/` without + specifying any tags after it. + +Examples: +* `edit 1 p/91234567 e/johndoe@example.com` Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. +* `edit 2 n/Betsy Crower t/` Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. + +### Locating persons by name: `find` + +Finds persons whose names contain any of the given keywords. + +Format: `find KEYWORD [MORE_KEYWORDS]` + +* The search is case-insensitive. e.g `hans` will match `Hans` +* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` +* Only the name is searched. +* Only full words will be matched e.g. `Han` will not match `Hans` +* Persons matching at least one keyword will be returned (i.e. `OR` search). + e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` + +Examples: +* `find John` returns `john` and `John Doe` +* `find alex david` returns `Alex Yeoh`, `David Li`
+ ![result for 'find alex david'](images/findAlexDavidResult.png) + +### Deleting a person : `delete` + +Deletes the specified person from the address book. + +Format: `delete INDEX` + +* Deletes the person at the specified `INDEX`. +* The index refers to the index number shown in the displayed person list. +* The index **must be a positive integer** 1, 2, 3, …​ + +Examples: +* `list` followed by `delete 2` deletes the 2nd person in the address book. +* `find Betsy` followed by `delete 1` deletes the 1st person in the results of the `find` command. + +### Clearing all entries : `clear` + +Clears all entries from the address book. + +Format: `clear` + +### Exiting the program : `exit` + +Exits the program. + +Format: `exit` + +### Saving the data + +AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually. + +### Archiving data files `[coming in v2.0]` + +_{explain the feature here}_ + +-------------------------------------------------------------------------------------------------------------------- + +## FAQ + +**Q**: How do I transfer my data to another Computer?
+**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous AddressBook home folder. + +-------------------------------------------------------------------------------------------------------------------- + +## Command summary + +Action | Format, Examples +--------|------------------ +**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​`
e.g., `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague` +**Clear** | `clear` +**Delete** | `delete INDEX`
e.g., `delete 3` +**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`
e.g.,`edit 2 n/James Lee e/jameslee@example.com` +**Find** | `find KEYWORD [MORE_KEYWORDS]`
e.g., `find James Jake` +**List** | `list` +**Help** | `help` diff --git a/docs/UsingAppVeyor.adoc b/docs/UsingAppVeyor.adoc deleted file mode 100644 index 12a7a89ac68..00000000000 --- a/docs/UsingAppVeyor.adoc +++ /dev/null @@ -1,94 +0,0 @@ -= AppVeyor -:site-section: DeveloperGuide -:imagesDir: images -:stylesDir: stylesheets -ifdef::env-github[] -:note-caption: :information_source: -endif::[] - -[NOTE] -==== -This document was originally written for _AddressBook Level 4_ and hence its screenshots refer to `addressbook-level4`. -For use with _AddressBook Level 3_, wherever `addressbook-level4` is used in the screenshots, you should use *`addressbook-level3`*. -==== - -https://www.appveyor.com/[AppVeyor] is a _Continuous Integration_ platform for GitHub projects. It runs its builds on Windows virtual machines. - -AppVeyor can run the project's tests automatically whenever new code is pushed to the repo. This ensures that existing functionality and features have not been broken on Windows by the changes. - -The current AppVeyor setup runs `gradlew.bat test` whenever someone pushes code to the repo. - -If you would like to customize your AppVeyor build further, you can learn more about AppVeyor from the https://www.appveyor.com/docs/[AppVeyor Documentation]. - -== Setting up AppVeyor - -. Fork the repo to your own organization. -. Go to https://ci.appveyor.com/, and under `Login`, click on `GitHub` to login with your GitHub account. Enter your GitHub account details if needed. -+ -image:appveyor/login.png[Click on GitHub in the login page] -+ -. After logging in, you will be brought to your projects dashboard. Click on `NEW PROJECT`. -+ -image:appveyor/add-project-1.png[Click on "NEW PROJECT" in the projects dashboard] -+ -. You will be brought to the `Select repository` page. Select `GitHub`. -* On your first usage of AppVeyor, you will need to give AppVeyor authorization to your GitHub account. Click on `Authorize GitHub`. -+ -image:appveyor/add-project-2.png[Click on Authorize GitHub] -+ -* This will bring you to a GitHub page that manages the access of third-party applications to your repositories. -+ -Depending on whether you are the owner of the repository, you can either -grant access: -+ -image:grant_access.png[Grant Access] -+ -Or request access: -+ -image:request_access.png[Request Access] -+ -. AppVeyor will then list the repositories you have access to in your GitHub account. Find the repository you want to set AppVeyor up on, and then click `ADD`. -+ -image:appveyor/add-project-3.png[Click "Add" on the repository you want to set AppVeyor up on] -+ -. AppVeyor will then be activated on that repository. To see the CI in action, push a commit to any branch! -* Go to the repository and see the pushed commit. There should be an icon which will link you to the AppVeyor build: -+ -image:appveyor/ci-pending.png[Commit build] -+ -* As the build is run on a remote machine, we can only examine the logs it produces: -+ -image:appveyor/ci-log.png[AppVeyor build] -+ -. Update the link to the "build status" badge at the top of `README.adoc` to point to the AppVeyor build status of your own repo. -* To find your build status badge URL, first go to your project settings by clicking on the "Settings" icon: -+ -image:appveyor/project-settings-1.png[Click on project settings] -+ -* Then go to the `Badges` section of your project settings by clicking on it: -+ -image:appveyor/project-settings-2.png[Click on "Badges"] -+ -* As AppVeyor does not provide asciidoc code for the badge, we will have to create our own. Start by copying the markdown code provided: -+ -image:appveyor/project-settings-3.png[Copy the markdown code] -+ -The markdown code should be in this format: -+ ----- -[![Build status]()]() ----- -+ -Convert it to the asciidoc format as follows: -+ ----- -[image:[Build status]] ----- -+ -The asciidoc code should look similar to: -+ ----- -https://ci.appveyor.com/project/damithc/addressbook-level3[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]] ----- -+ -Copy and paste the asciidoc code to your `README.adoc` file. diff --git a/docs/UsingCheckstyle.adoc b/docs/UsingCheckstyle.adoc deleted file mode 100644 index a12ab09cc9c..00000000000 --- a/docs/UsingCheckstyle.adoc +++ /dev/null @@ -1,48 +0,0 @@ -= Using Checkstyle-IDEA -:site-section: DeveloperGuide -:imagesDir: images -:stylesDir: stylesheets -:experimental: -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -endif::[] - -[NOTE] -==== -This document was originally written for _AddressBook Level 4_ and hence its screenshots refer to `addressbook-level4`. -For use with _AddressBook Level 3_, wherever `addressbook-level4` is used in the screenshots, you should use *`addressbook-level3`*. -==== - -== Configuring Checkstyle-IDEA - -. Install the Checkstyle-IDEA plugin by going to `File` > `Settings` (Windows/Linux), or `IntelliJ IDEA` > `Preferences...` (macOS). + -Select `Plugins`, press `Browse Repository`, and find the plugin. + -Restart the IDE to complete the installation. -. Click `File` > `Settings...` > `Other Settings` > `Checkstyle` -. Set `Scan Scope` to `Only Java sources (including tests)`, so that the plugin will run checkstyle for our test source codes as well -. Ensure that the `Checkstyle version` is set to `8.1`. This is the same version that we are using inside Gradle, so that you won't get any errors due to version incompatibility - * If `Checkstyle version` is not set to `8.1`, set it to version `8.1` and click `Apply` -+ -image::checkstyle-idea-scan-scope.png[width="500"] -. Click the plus sign under `Configuration File` -. Enter an arbitrary description e.g. addressbook -. Select `Use a local Checkstyle file` -. Use the checkstyle configuration file found at `config/checkstyle/checkstyle.xml` -. Click `Next` > `Finish` -. Mark `Active` for the newly imported check configuration -+ -image::checkstyle-idea-configuration.png[width="700"] -. Click `OK` - -== Troubleshooting Checkstyle-IDEA - -**Problem: When importing `checkstyle.xml`, Checkstyle-IDEA plugin complains that `The Checkstyle rules file could not be parsed. ... The file has been blacklisted for 60s.`** - -* Reason: `checkstyle.xml` is written for a particular version, but the plugin was not configured to the correct version. -* Solution: Ensure that you have selected the correct `Checkstyle version` that matches the version in `build.gradle` and have clicked `Apply`, as `checkstyle.xml` is written for Gradle's checkstyle. - -**Problem: After setting up `checkstyle.xml`, Checkstyle-IDEA plugin does not seem to highlight the errors / real-time scanning seems broken.** - -* Reason: The plugin may not immediately run after setting it up. -* Solution: Restart the IDE. diff --git a/docs/UsingCheckstyle.md b/docs/UsingCheckstyle.md new file mode 100644 index 00000000000..201e3bd6e89 --- /dev/null +++ b/docs/UsingCheckstyle.md @@ -0,0 +1,54 @@ +--- +layout: page +title: Using Checkstyle +--- + + +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- + +## Using Checkstyle-IDEA plugin + +Given below are the steps to install the Checkstyle-IDEA plugin so that Intellij can alert you about code style problems as you write code. + +1. Install the Checkstyle-IDEA plugin by going to `File` \> `Settings` (Windows/Linux), or `IntelliJ IDEA` \> `Preferences…​` (macOS). Select `Plugins`, press `Browse Repository`, and find the plugin. Restart the IDE to complete the installation. + +1. Click `File` \> `Settings…​` \> `Other Settings` \> `Checkstyle` + +1. Set `Scan Scope` to `Only Java sources (including tests)`, so that the plugin will run checkstyle for our test source codes as well + +1. Ensure that the `Checkstyle version` is set to `8.1`. This is the same version that we are using inside Gradle, so that you won’t get any errors due to version incompatibility.
+ If `Checkstyle version` is not set to `8.1`, set it to version `8.1` and click `Apply`
+ ![checkstyle idea scan scope](images/checkstyle-idea-scan-scope.png) + +1. Click the plus sign under `Configuration File` + +1. Enter an arbitrary description e.g. addressbook + +1. Select `Use a local Checkstyle file` + +1. Use the checkstyle configuration file found at `config/checkstyle/checkstyle.xml` + +1. Click `Next` \> `Finish` + +1. Mark `Active` for the newly imported check configuration
+ ![checkstyle idea configuration](images/checkstyle-idea-configuration.png) + +1. Click `OK` + +1. To verify the plugin is set up correctly, temporirily modify the code to violate a style rule (e.g., add an extra space somewhere) and run the CheckStyle check using the plugin.
+ ![run checkstyle plugin](images/checkstyle/runCheckstyle.png) + +#### Troubleshooting + +**Problem: When importing `checkstyle.xml`, Checkstyle-IDEA plugin complains that `The Checkstyle rules file could not be parsed. …​ The file has been blacklisted for 60s.`** +* Reason: `checkstyle.xml` is written for a particular version, but the plugin was not configured to the correct version. +* Solution: Ensure that you have selected the correct `Checkstyle + version` that matches the version in `build.gradle` and have clicked + `Apply`, as `checkstyle.xml` is written for Gradle’s checkstyle. + +**Problem: After setting up `checkstyle.xml`, Checkstyle-IDEA plugin does not seem to highlight the errors / real-time scanning seems broken.** +* Reason: The plugin may not immediately run after setting it up. +* Solution: Restart the IDE. diff --git a/docs/UsingCoveralls.adoc b/docs/UsingCoveralls.adoc deleted file mode 100644 index 5191e47316c..00000000000 --- a/docs/UsingCoveralls.adoc +++ /dev/null @@ -1,63 +0,0 @@ -= Using Coveralls -:site-section: DeveloperGuide -:imagesDir: images -:stylesDir: stylesheets -ifdef::env-github[] -:note-caption: :information_source: -endif::[] - -[NOTE] -==== -This document was originally written for _AddressBook Level 4_ and hence its screenshots refer to `addressbook-level4`. -For use with _AddressBook Level 3_, wherever `addressbook-level4` is used in the screenshots, you should use *`addressbook-level3`*. -==== - -https://coveralls.io/[Coveralls] is a web service that tracks code coverage over time for GitHub projects. -Coveralls requires Travis CI to be set up beforehand as Travis sends the coverage report from the latest build to Coveralls. -If you have not set up Travis CI, see <>. Currently, Coveralls supports Travis CI but not AppVeyor. - -== Setting up Coveralls - -. Go to https://coveralls.io/ and click `SIGN IN`. Then click `GITHUB SIGN IN` and enter your GitHub account details if needed. -+ -. After logging in, you will be brought to the `Your Repositories` page. On the site's navigation bar, click https://coveralls.io/repos/new[ADD REPOS]. -+ -. Find the switch for the forked repository. -* If the organization is not shown, click `GITHUB SETTINGS` as shown below: -+ -image:coveralls/github_settings.png[GitHub settings] -+ -This should bring you to a GitHub page that manages the access of third-party applications. Depending on whether you are the owner of the repository, you can either grant access -+ -image:grant_access.png[Grant Access] -+ -or request access -+ -image:request_access.png[Request Access] -+ -to Coveralls so that it can access your repository. -* If your repository cannot be found, click `SYNC REPOS`. -+ -image:coveralls/sync_repos.png[Sync repos] -+ -. Activate the switch. -+ -image:coveralls/flick_repository_switch.png[Activate the switch] -+ -. Update the link of the `Coverage Status` badge at the top of your <> to point to that of your own repo by replacing the outlined areas with `your-org-name/your-repo-name`. -+ -image:coveralls/coverage_asciidoc_code.png[Coverage Status Badge] -+ -. You can now see the coverage report for your project after each Travis build by clicking on the `Coverage Status` badge. -+ -image:coveralls/coverage_report.png[Coverage Report Summary] - -== Disabling Coveralls Automatic Comments on Pull Requests - -Coveralls automatically comments on the coverage status of the pull requests in GitHub. If it's a hindrance, you can disable it in the settings of your project in Coveralls: - -. Click `Settings`. -+ -. Uncheck the `LEAVE COMMENTS?` checkbox. Then click `SAVE CHANGES`. -+ -image:coveralls/disable_comments.png[Disable comments, width = 942] diff --git a/docs/UsingGradle.adoc b/docs/UsingGradle.adoc deleted file mode 100644 index cca9c6d1d12..00000000000 --- a/docs/UsingGradle.adoc +++ /dev/null @@ -1,99 +0,0 @@ -= Using Gradle -:site-section: DeveloperGuide -:imagesDir: images -:stylesDir: stylesheets -:experimental: -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -endif::[] - -https://gradle.org/[Gradle] is a build automation tool. It can automate build-related tasks such as - -* Running tests -* Managing library dependencies -* Analyzing code for style compliance - -The gradle configuration for this project is defined in the _build script_ link:../build.gradle[`build.gradle`]. - -[NOTE] -To learn more about gradle build scripts, refer https://docs.gradle.org/current/userguide/tutorial_using_tasks.html[Build Scripts Basics]. - -== Running Gradle Commands - -To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: - -* On Windows: `gradlew ...` e.g. `gradlew clean test` -* On Mac/Linux: `./gradlew ...` e.g. -`./gradlew clean test` - -[NOTE] -If you do not specify any tasks, Gradlew will run the default tasks `clean` `test` `coverage` - -== Cleaning the Project - -* *`clean`* + -Deletes the files created during the previous build tasks (e.g. files in the `build` folder). e.g. `./gradlew clean` - -[TIP] -*`clean` to force Gradle to execute a task*: + -When running a Gradle task, Gradle will try to figure out if the task needs running at all. If Gradle determines that the output of the task will be same as the previous time, it will not run the task. For example, it will not build the JAR file again if the relevant source files have not changed since the last time the JAR file was built. If we want to force Gradle to run a task, we can combine that task with `clean`. Once the build files have been `clean` ed, Gradle has no way to determine if the output will be same as before, so it will be forced to execute the task. - -== Creating the JAR file - -* *`shadowJar`* + -Creates the `addressbook.jar` file in the `build/jar` folder, _if the current file is outdated_. + -e.g. `./gradlew shadowJar` - -**** -To force Gradle to create the JAR file even if the current one is up-to-date, you can '`clean`' first. + -e.g. `./gradlew clean shadowJar` -**** - -[NOTE] -*Why do we create a fat JAR?* If we package only our own class files into the JAR file, it will not work properly unless the user has all the other JAR files (i.e. third party libraries) our classes depend on, which is rather inconvenient. Therefore, we package all dependencies into a single JAR files, creating what is also known as a _fat_ JAR file. To create a fat JAR file, we use the Gradle plugin https://github.com/johnrengelman/shadow[shadow jar]. - -== Rendering AsciiDoc files - -* **`asciidoctor`** + -Converts AsciiDoc files in `docs` to HTML format. Generated HTML files can be found in `build/docs`. -* **`deployOfflineDocs`** + -Updates the offline user guide, and its associated files, used by the Help window in the application. Deployed HTML files and images can be found in `src/main/resources/docs`. - -== Running the application - -* *`run`* + -Builds and runs the application. -* *`runShadow`* + -Builds the application as a fat JAR, and then runs it. - -== Running code style checks - -* **`checkstyleMain`** + -Runs the code style check for the main code base -* **`checkstyleTest`** + -Runs the code style check for the test code base - -The set of code style rules implemented can be found in `config/checkstyle/checkstyle.xml`. To enable _exceptions_ to code styles, add in the comment `//CODESTYLE.OFF: RuleName` at the start of the section and `//CODESTYLE.ON: RuleName` at the end of the section. - -== Running Tests - -* **`test`** + -Runs all tests. - -Here are some examples: - -* `./gradlew test` -- Runs all tests -* `./gradlew clean test` -- Cleans the project and runs tests - -== Updating Dependencies - -There is no need to run these Gradle tasks manually as they are called automatically by other relevant Gradle tasks. - -* **`compileJava`** + -Checks whether the project has the required dependencies to compile and run the main program, and download any missing dependencies before compiling the classes. + -See `build.gradle` -> -`allprojects` -> `dependencies` -> `compile` for the list of dependencies required. -* **`compileTestJava`** + -Checks whether the project has the required dependencies to perform testing, and download any missing dependencies before compiling the test classes. + -See `build.gradle` -> `allprojects` -> `dependencies` -> `testCompile` for the list of dependencies required. diff --git a/docs/UsingGradle.md b/docs/UsingGradle.md new file mode 100644 index 00000000000..fe8e92c33bf --- /dev/null +++ b/docs/UsingGradle.md @@ -0,0 +1,72 @@ +--- +layout: page +title: Using Gradle +--- + + +**If you are new to Gradle, please read [this Gradle Tutorial from the Duke project](https://github.com/se-edu/duke/blob/master/tutorials/gradleTutorial.md)**. + + +
+ +:information_source: **Reminder:** To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: + +* On Windows: `gradlew …​` e.g. `gradlew clean test` +* On Mac/Linux: `./gradlew …​` e.g. `./gradlew clean + test` + +
+ +Given below are how to use Gradle for some important project tasks. + + +* Table of Contents +{:toc} + +-------------------------------------------------------------------------------------------------------------------- +## Cleaning the project + +* **`clean`**: Deletes the files created during the previous build tasks (e.g. files in the `build` folder).
+ e.g. `./gradlew clean` + +
+ +:bulb: **Tip:** You can use **`clean` to prevent Gradle from skipping tasks**: When running a Gradle task, Gradle will try to figure out if the task needs running at all. If Gradle determines that the output of the task will be same as the previous time, it will not run the task. For example, it will not build the JAR file again if the relevant source files have not changed since the last time the JAR file was built. If you want to force Gradle to run a task, you can combine that task with `clean` (e.g., `./gradlew clean shadowJar`). Once the build files have been `clean` ed, Gradle has no way to determine if the output will be same as before, and it will have no choice but to execute the task. + +
+ +## Creating the JAR file + +* **`shadowJar`**: Uses the ShadowJar plugin to creat a fat JAR file in the `build/jar` folder, *if the current file is outdated*.
+ e.g. `./gradlew shadowJar`. + +
+ +:information_source: **Note:** **What's a _fat_ JAR? Why do we need one?** If you package only your own class files into the JAR file, it will not work properly unless the user has all the other JAR files (i.e. third-party libraries) your classes depend on, which is rather inconvenient. Therefore, you should package all dependencies into a single JAR files, creating what is also known as a _fat_ JAR file. To create a fat JAR file, use the Gradle plugin [shadow jar](https://github.com/johnrengelman/shadow). +
+ +## Running the application + +* **`run`**: Builds and runs the application. +* **`runShadow`**: Builds the application as a fat JAR, and then runs it. + +## Running code style checks + +* **`checkstyleMain`**: Runs the code style check for the main code base. +* **`checkstyleTest`**: Runs the code style check for the test code base. + +The set of code style rules implemented can be found in `config/checkstyle/checkstyle.xml`. To enable *exceptions* to code styles, add in the comment `//CODESTYLE.OFF: RuleName` at the start of the section and `//CODESTYLE.ON: RuleName` at the end of the section. + +## Running Tests + +* **`test`**: Runs all tests.
+ Examples: + * `./gradlew test` — Runs all tests + * `./gradlew clean test` — Cleans the project and runs tests + +## Compiling + +There is no need to run these Gradle tasks manually as they are called automatically by other relevant Gradle tasks. + +* **`compileJava`**: Checks whether the project has the required dependencies to compile and run the main program, and download any missing dependencies before compiling the classes. See `build.gradle` → `allprojects` → `dependencies` → `compile` for the list of dependencies required. +* **`compileTestJava`**: Checks whether the project has the required dependencies to perform testing, and download any missing dependencies before compiling the test classes. See `build.gradle` → `allprojects` → `dependencies` → `testCompile` for the list of dependencies required. diff --git a/docs/UsingNetlify.adoc b/docs/UsingNetlify.adoc deleted file mode 100644 index 2e108c936a3..00000000000 --- a/docs/UsingNetlify.adoc +++ /dev/null @@ -1,59 +0,0 @@ -= Using Netlify -:site-section: DeveloperGuide -:imagesDir: images -:stylesDir: stylesheets -ifdef::env-github[] -:note-caption: :information_source: -endif::[] - -[NOTE] -==== -This document was originally written for _AddressBook Level 4_ and hence its screenshots refer to `addressbook-level4`. -For use with _AddressBook Level 3_, wherever `addressbook-level4` is used in the screenshots, you should use *`addressbook-level3`*. -==== - -https://www.netlify.com/[Netlify] is an automated hosting platform for deploying static websites. With the aid of build tools such as Gradle, Netlify provides a smoother experience for previewing documentation. This can be done by using Netlify's https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/[Deploy Previews] feature, which shows a preview of the updated documentation whenever a pull request is made. - -== Setting up Netlify -. Fork the repository to your own organization. -+ -. Go to https://www.netlify.com/ and click `Sign Up`. Next, click `GITHUB SIGN IN`, enter your GitHub account details and authorize netlify. -+ -. After logging in, click `New site from Git`. -+ -. You will then be brought to the setup page. Click `GitHub` to link your repository to Netlify. -* Depending on whether you are the owner of the repository, you can either grant or request access to Netlify so that it can access your repository and build your documentation. -+ -image:netlify/grant_or_request_access.png[Grant or request access, width = 630] -* After granting or requesting access to your repository, click `Authorize netlify`. -+ -. Pick your repository from the list. -+ -. Fill out the details as follows and then click `Deploy site`. -* Branch to deploy: select `master` branch -* Build command: `./gradlew asciidoctor` -+ -[NOTE] -The build command is the command that builds the documentation into HTML format. -+ -* Publish directory: `build/docs/html5` -[NOTE] -The publish directory is the directory in which the built HTML documentation resides. -+ -. Once Netlify has completed building your project, you can now: -* View your main branch's deployed documentation on the site name given by Netlify (customizable as shown <>). -+ -image:netlify/temp_site_name.png[Temporary site name, width = 630] -+ -* Preview the updated documentation whenever a pull request is made by clicking the `Details` hyperlink next to the Netlify test status. -+ -image:netlify/netlify_details.png[Netlify details link, width = 630] - -== Changing the site name of your project -If you don't like the site name given by Netlify, you can change it as follows: - -. Click on `Settings`. -+ -. Then click `Change site name` and fill in your desired site name. -+ -image:netlify/change_site_name.png[Change site name, width = 630] diff --git a/docs/UsingNetlify.md b/docs/UsingNetlify.md new file mode 100644 index 00000000000..2ed164341c2 --- /dev/null +++ b/docs/UsingNetlify.md @@ -0,0 +1,51 @@ +--- +layout: page +title: Using Netlify +--- + +[Netlify](https://www.netlify.com/) is an automated hosting platform for deploying static websites. It is particularly useful for previewing documentation changes in a PR (i.e., how would the final output of the documentation will change if the PR is merged), which can be done using Netlify’s [Deploy Previews](https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/) feature. + +
+ +:exclamation: **Caution:** Netlify allows only 300 free build minutes per month. They use an unsavory practice of letting you exceed the limit and then sending you an invoice for the extra use. You will not be able to use Netlify again unless you pay (or get them to cancel the charge). Therefore, we caution you to use Netlify (if at all) during times you update documentation and only if you want to use Netlify _Deploy Previews_ to help review such PRs. + +
+ +* Table of Contents +{:toc} + + +## Setting up + +1. Go to and click `Sign Up`. Next, click `GITHUB SIGN IN`, enter your GitHub account details and authorize netlify. + +1. After logging in, click `New site from Git`. + +1. You will then be brought to the setup page. Click `GitHub` to link your repository to Netlify. + * Depending on whether you are the owner of the repository, you can either grant or request access to Netlify so that it can access your repository and build your documentation.
+ ![Grant or request access](images/netlify/grant_or_request_access.png) + * After granting or requesting access to your repository, click `Authorize netlify`. + +1. Pick your repository from the list. + +1. Fill out the details as follows and then click `Deploy site`. + * Branch to deploy: select `master` branch + * Build command: `cd docs && bundle install && bundle exec jekyll build` + * Publish directory: `docs/_site` + + +1. Once Netlify has completed building your project, you can now: + * View your main branch’s deployed documentation on the site name given by Netlify (customizable as shown [below](#changing_the_site_name)).
+ ![Temporary site name](images/netlify/temp_site_name.png) + * Preview the updated documentation whenever a pull request is made by clicking the `Details` hyperlink next to the Netlify test status.
+ ![Netlify details link](images/netlify/netlify_details.png) + + +## Changing the site name + +If you don’t like the site name given by Netlify, you can change it as follows: + +1. Click on `Settings`. + +2. Then click `Change site name` and fill in your desired site name.
+ ![Change site name](images/netlify/change_site_name.png) diff --git a/docs/UsingPlantUml.adoc b/docs/UsingPlantUml.adoc deleted file mode 100644 index cfe2533ea84..00000000000 --- a/docs/UsingPlantUml.adoc +++ /dev/null @@ -1,211 +0,0 @@ -= Using PlantUML -:site-section: DeveloperGuide -:imagesDir: images/plantuml -:stylesDir: stylesheets -:experimental: -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -endif::[] - -== Introduction to PlantUML - -PlantUML is a tool used in this project to create UML diagrams. -For more information about the basics of PlantUML, head over to http://plantuml.com/[its official website]. - -== Set up PlantUML - -=== Installing Graphviz - -Graphviz is a dependency that PlantUML requires to generate more advanced diagrams. -Head over to the https://www.graphviz.org/download/[downloads page] on the official Graphviz website and follow instructions to install Graphviz. - -=== Installing the `PlantUML integration` plugin for IntelliJ IDEA - -Go to `Settings` > `Plugins` > `Marketplace` and install the plugin `PlantUML integration`. - -Then go to `Settings` > `Other Settings` > `PlantUML` or search for PlantUML. -Configure the path to the `dot` executable. -This executable can be found in the `/bin` directory where you installed GraphViz. - -.Settings - Other Settings - PlantUML: input the path to your dot executable -image::ConfiguringGraphviz.png[] - -== Create/Edit PlantUML diagrams - -After installing the `PlantUML integration` plugin, simply create or open any `.puml` file to start editing it. - -.Editing `DeleteSequenceDiagram.puml` -image::EditingDeleteSequenceDiagram.png[] -Any changes you make in editor pane on the left will be reflected in the preview pane on the right. -However, do take note that these changes _will not_ be reflected in the developers guide until you export the diagram. -//TODO: Discussion about why we're not using asciidoctor-diagram - -== Export PlantUML diagrams - -The `PlantUML integration` plugin allows you to export individual diagrams to a location of your choosing. -Click the `Save Current Diagram Only` button and choose the location to export the image file. - -NOTE: You will have to `git add` any new diagrams generated! - -== Common tasks - -=== Applying consistent formatting to PlantUML diagrams - -It is highly recommended to consistently color your UML diagrams as an visual aid. -You can achieve this by creating a dictionary of colors and import it like CSS. - -For example, you can create a `Style.puml` with the contents: - -.Style.puml -[source] ----- -... -!define LOGIC_COLOR #3333C4 -!define LOGIC_COLOR_T1 #7777DB -!define LOGIC_COLOR_T2 #5252CE -!define LOGIC_COLOR_T3 #1616B0 -!define LOGIC_COLOR_T4 #101086 -... ----- - -Then you can use it in another PlantUML file like this: - -.UndoSequenceDiagram.puml -[source] ----- -!include Style.puml - -box Logic LOGIC_COLOR_T2 -participant ":LogicManager" as LogicManager LOGIC_COLOR -participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR -participant ":UndoCommand" as UndoCommand LOGIC_COLOR -end box ----- - -You can fine-tune the formatting of PlantUML diagrams with the `skinparam` command. -For example, `skinparam backgroundColor transparent` turns the background of the diagram transparent. - -For a comprehensive list of ``skinparam``s head over to the https://plantuml-documentation.readthedocs.io/en/latest/[unofficial PlantUML skinparam documentation]. - -*** - -=== Repositioning elements in PlantUML diagrams - -While PlantUML's automatic layout engine usually produces satisfactory results, at times the result can be less than ideal, especially on larger diagrams. -Here is an example where the default layout generated by PlantUML has a lot of overlapping lines that are hard to decipher: - -.The UI class diagram without additional formatting -image::RawUiDiagram.png[] - -NOTE: In most cases, you should consider decomposing the diagram into smaller ones or focusing on a more specific portion of the diagram. - -Here are some of the techniques we used in this project to obtain a more palatable diagram. - -==== Link lengths -By default, a short link (`\->`) points to right and a long link (`-\->`) -points downwards. you can extend any link to make it longer (```--\->```). - -.Length of arrows and its effects -image::ArrowLength.png[] - -==== Link directions -Clever usage of arrow directions will resolve most layout issues. -For example, the table below shows how the way in which you specify arrows can results in drastically different layouts for the same diagram. - -.Link directions -[cols="40a,60a"] -|=== -|Source |Result - -|[source, puml] ----- -A --> Z -B --> Z -C --> Z -D --> Z - -A --> 1 -B --> 2 -C --> 3 -D --> 4 ----- -|image::AllDown.png[] - -|[source, puml] ----- -'default is down -A --> Z -'specify down -B -down-> Z -'shorthand for down -C -d-> Z -'arrow lengths take priority -D -down> Z - -A -up-> 1 -B -up-> 2 -C -up-> 3 -D -up-> 4 - ----- -|image::UpAndDown.png[] - -|[source, puml] ----- -A -up-> Z -B -up-> Z -C -up-> Z -D -up-> Z - -A --> 1 -B --> 2 -C --> 3 -D --> 4 - -'Force A B C D -A -right[hidden]- B -B -right[hidden]- C -C -right[hidden]- D ----- -|image::HiddenArrows.png[] -|=== - -==== Reordering definitions -As a general rule of thumb, the layout engine will attempt to order objects in the order in which they are defined. -If there is no formal definition, the objects is taken to be declared upon its first usage. - -.Definition ordering and outcomes -[cols="70a,30a"] -|=== -|Source |Result - -|[source, puml] ----- -A --> B -C --> D ----- -|image::ABeforeC.png[] - -|[source, puml] ----- -'Class C is defined before A -Class C - -A --> B -C --> D ----- -|image::CBeforeA.png[] - -|[source, puml] ----- -package "Rule Of Thumb"{ - Class C - A --> B - C --> D -} ----- -|image::PackagesAndConsistency.png[] -|=== - -TIP: Explicitly define all symbols to avoid any potential layout mishaps. diff --git a/docs/UsingPlantUml.md b/docs/UsingPlantUml.md new file mode 100644 index 00000000000..0ff7239c0bb --- /dev/null +++ b/docs/UsingPlantUml.md @@ -0,0 +1,266 @@ +--- +layout: page +title: Using PlantUML +--- + +This project uses [PlantUML](http://plantuml.com/) to create UML diagrams. One main advantage of using PlantUML is, as diagrams can be saved in a text format, you can update the diagrams incrementally, as the design evolves over time. + +* Table of Contents +{:toc} + +------------------------------------------------------------------------------------------------------------------ + +## Setting up PlantUML + +1. **Install Graphviz.** Graphviz is a dependency that PlantUML requires to generate more advanced diagrams. Head over to the [downloads page](https://www.graphviz.org/download/) on the official Graphviz website and follow instructions to install Graphviz. + +1. **Install the `PlantUML integration` plugin in IntelliJ IDEA.** + + 1. Go to `Settings` \> `Plugins` \> `Marketplace` and install the plugin `PlantUML integration`. + + 1. Then go to `Settings` \> `Other Settings` \> `PlantUML` or search for PlantUML. Configure the path to the `dot` executable. This executable can be found in the `/bin` directory where you installed GraphViz.
+ ![Settings - Other Settings - PlantUML: input the path to your dot executable](images/plantuml/ConfiguringGraphviz.png) + +------------------------------------------------------------------------------------------------------------------ + +## Creating/editing/exporting diagrams + +After installing the `PlantUML integration` plugin, simply create or open any `.puml` file to start editing it. + +![Editing `DeleteSequenceDiagram.puml`](images/plantuml/EditingDeleteSequenceDiagram.png) + +Any changes you make in editor pane on the left will be reflected in the preview pane on the right. However, do take note that these changes *will not* be reflected in your actual documentation until you export the diagram. + +The `PlantUML integration` plugin allows you to export individual diagrams to a location of your choosing. Click the `Save Current Diagram Only` button and choose the location to export the image file. + +
:information_source: **Note:** + +You will have to `git add` any new diagrams generated\! +
+ +------------------------------------------------------------------------------------------------------------------ + +## Tips and tricks + +### Maintaining consistency in formatting + +It is highly recommended to consistently color your UML diagrams as an visual aid. You can achieve this by creating a dictionary of colors and import it like CSS. + +For example, you can create a `Style.puml` with the contents: + +**Style.puml.** + +```puml +!define LOGIC_COLOR #3333C4 +!define LOGIC_COLOR_T1 #7777DB +!define LOGIC_COLOR_T2 #5252CE +!define LOGIC_COLOR_T3 #1616B0 +!define LOGIC_COLOR_T4 #101086 +``` + + +Then you can use it in another PlantUML file like this: + +**UndoSequenceDiagram.puml.** + +```puml +!include Style.puml + +box Logic LOGIC_COLOR_T2 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant ":UndoCommand" as UndoCommand LOGIC_COLOR +end box +``` + +You can fine-tune the formatting of PlantUML diagrams with the `skinparam` command. For example, `skinparam backgroundColor transparent` turns the background of the diagram transparent. + +
+ +:link: **Link**: For a comprehensive list of `skinparam`s head over to the [unofficial PlantUML skinparam documentation](https://plantuml-documentation.readthedocs.io/en/latest/). +
+ + +### Repositioning elements + +While PlantUML’s automatic layout engine usually produces satisfactory results, at times the result can be less than ideal, especially on larger diagrams. Here is an example where the default layout generated by PlantUML has a lot of overlapping lines that are hard to decipher: + +![The UI class diagram without additional formatting](images/plantuml/RawUiDiagram.png) + +
+ +:information_source: **Note:** In most cases, you should consider decomposing the diagram into smaller ones or focusing on a more specific portion of the diagram. + +
+ +Here are some techniques you can use to obtain a more palatable diagram. + +#### Link lengths + +By default, a short link (`->`) points to right and a long link (`-->`) points downwards. you can extend any link to make it longer (`--->`). + +![Length of arrows and its effects](images/plantuml/ArrowLength.png) + +#### Link directions + +Clever usage of arrow directions will resolve most layout issues. For example, the table below shows how the way in which you specify arrows can results in drastically different layouts for the same diagram. + + + ++++ + + + + + + + + + + + + + + + + + + + + +
Table: Link directions
SourceResult
+
+A --> Z
+B --> Z
+C --> Z
+D --> Z
+
+A --> 1
+B --> 2
+C --> 3
+D --> 4
+
+
+ + + +
+ +
+'default is down
+A --> Z
+'specify down
+B -down-> Z
+'shorthand for down
+C -d-> Z
+'arrow lengths take priority
+D -down> Z
+
+A -up-> 1
+B -up-> 2
+C -up-> 3
+D -up-> 4
+
+ +
+ + + +
+ +
+A -up-> Z
+B -up-> Z
+C -up-> Z
+D -up-> Z
+
+A --> 1
+B --> 2
+C --> 3
+D --> 4
+
+'Force A B C D
+A -right[hidden]- B
+B -right[hidden]- C
+C -right[hidden]- D
+
+ +
+ + + +
+ +**Another technique you can use to influence the layout is to reorder definitions.** The layout engine will attempt to order objects in the order in which they are defined. If there is no formal definition, the objects is taken to be declared upon its first usage. + + + ++++ + + + + + + + + + + + + + + + + + + + + +
Table: Definition ordering and outcomes
SourceResult
+ +
+A --> B
+C --> D
+
+ +
+ + + +
+ +
+'Class C is defined before A
+Class C
+
+A --> B
+C --> D
+
+
+ + + +
+ +
+package "Rule Of Thumb";{
+    Class C
+    A --> B
+    C --> D
+}
+
+ +
+ + +
+ +
:bulb: **Tip:** +Explicitly define all symbols to avoid any potential layout mishaps. +
diff --git a/docs/UsingTravis.adoc b/docs/UsingTravis.adoc deleted file mode 100644 index 764e0b0b9d9..00000000000 --- a/docs/UsingTravis.adoc +++ /dev/null @@ -1,140 +0,0 @@ -= Travis CI -:site-section: DeveloperGuide -:imagesDir: images -:stylesDir: stylesheets -ifdef::env-github[] -:note-caption: :information_source: -endif::[] - -[NOTE] -==== -This document was originally written for _AddressBook Level 4_ and hence its screenshots refer to `addressbook-level4`. -For use with _AddressBook Level 3_, wherever `addressbook-level4` is used in the screenshots, you should use *`addressbook-level3`*. -==== - -https://travis-ci.org/[Travis CI] is a _Continuous Integration_ platform for GitHub projects. - -Travis CI can run the projects' tests automatically whenever new code is pushed to the repo. This ensures that existing functionality and features have not been broken by the changes. - -The current Travis CI set up performs the following things whenever someone push code to the repo: - -* Runs the `./gradlew clean test coverage coveralls -i` command (see <> for more details on what this command means). -* Renders documentation from asciidoc to html and automatically publishes them using GitHub Pages. -* Runs additional link:#repository-wide-checks[repository-wide checks]. - -If you would like to customise your travis build further, you can learn more about Travis from https://docs.travis-ci.com/[Travis CI Documentation]. - -== Setting up Travis CI - -. Fork the repo to your own organization. -. Go to https://travis-ci.org/ and click `Sign in with GitHub`, then enter your GitHub account details if needed. -+ -image:signing_in.png[Signing into Travis CI] -+ -. Head to the https://travis-ci.org/profile[Accounts] page, and find the switch for the forked repository. -* If the organization is not shown, click `Review and add` as shown below: -+ -image:review_and_add.png[Review and add] -+ -This should bring you to a GitHub page that manages the access of third-party applications. Depending on whether you are the owner of the repository, you can either grant access -+ -image:grant_access.png[Grant Access] -+ -or request access -+ -image:request_access.png[Request Access] -+ -to Travis CI so that it can access your commits and build your code. -* If repository cannot be found, click `Sync account` -. Activate the switch. -+ -image:flick_repository_switch.png[Activate the switch] -+ -. This repo comes with a link:../.travis.yml[`.travis.yml`] that tells Travis what to do. So there is no need for you to create one yourself. -. To see the CI in action, push a commit to the master branch! -* Go to the repository and see the pushed commit. There should be an icon which will link you to the Travis build. -+ -image:build_pending.png[Commit build] -+ -* As the build is run on a provided remote machine, we can only examine the logs it produces: -+ -image:travis_build.png[Travis build] -+ -. If the build is successful, you should be able to check the coverage details of the tests at http://coveralls.io/[Coveralls] -. Update the link to the 'build status' badge at the top of the `README.adoc` to point to the build status of your own repo. - -== Enabling auto-publishing of documentation - -. Ensure that you have followed the steps above to set up Travis CI. -. On GitHub, create a new user account and give this account collaborator and admin access to the repo. + - Using this account, generate a personal access token https://github.com/settings/tokens/new[here]. -+ -[NOTE] -Personal access tokens are like passwords so make sure you keep them secret! If the personal access token is leaked, please delete it and generate a new one. -+ -[NOTE] -We use a new user account to generate the token for team projects to prevent team members from gaining access to other team members' repos. + -If you are the only one with write access to the repo, you can use your own account to generate the token. -+ --- -* Add a description for the token. (e.g. `Travis CI - deploy docs to gh-pages`) -* Check the `public_repo` checkbox. -* Click `Generate Token` and copy your new personal access token. --- -We will use this token to grant Travis access to the repo. -+ -image:generate_token.png[Generate token] - -. Head to the https://travis-ci.org/profile[Accounts] page, and find the switch for the forked repository. -+ -image:flick_repository_switch.png[Activate the switch] -+ -. Click on the settings button next to the switch. In the Environment Variables section, add a new environment variable with -+ --- -* name: `GITHUB_TOKEN` -* value: personal access token copied in step 1 -* Display value in build log: `OFF` --- -image:travis_add_token.png[Travis add token] -+ -[NOTE] -*Make sure you set `Display value in build log` to `OFF`.* + -Otherwise, other people will be able to see the personal access token and thus have access this repo. + -Similarly, make sure you *do not print `$GITHUB_TOKEN` to the logs* in Travis scripts as the logs are viewable by the public. - -. Now, whenever there's a new commit to master branch, Travis will push the latest documentation to gh-pages branch. - -**To verify that it works,** - -. Trigger Travis to regenerate documentation. To do so, you need to push a new commit to the master branch of the fork. + - Suggested change: Remove the codacy badge from `README`. -. Wait for Travis CI to finish running the build on your new commit. -. Go to the URL `\https://.github.io/addressbook-level3/`. You should see your `README` file displayed. - -== Repository-wide checks - -In addition to running Gradle checks, we also configure Travis CI to run some repository-wide checks. Unlike the Gradle checks which only cover files used in the build process, these repository-wide checks cover _all_ files in the repository. They check for repository rules which are hard to enforce on development machines such as line ending requirements. - -These checks are implemented as POSIX shell scripts, and thus can only be run on POSIX-compliant operating systems such as macOS and Linux. To run all checks locally on these operating systems, execute the following in the repository root directory: - -[source,shell] ----- -./config/travis/run-checks.sh ----- - -Any warnings or errors will be printed out to the console. - -=== Implementing new checks - -Checks are implemented as executable `check-*` scripts within the `config/travis/` directory. The `run-checks.sh` script will automatically pick up and run files named as such. - -Check scripts should print out errors in the following format: - -.... -SEVERITY:FILENAME:LINE: MESSAGE -.... - -where `SEVERITY` is either `ERROR` or `WARN`, `FILENAME` is the path to the file relative to the current directory, `LINE` is the line of the file where the error occurred and `MESSAGE` is the message explaining the error. - -Check scripts must exit with a non-zero exit code if any errors occur. diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 00000000000..29ec7733e40 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,14 @@ +title: "AB-3" +theme: minima + +header_pages: + - UserGuide.md + - DeveloperGuide.md + - AboutUs.md + +markdown: kramdown + +repository: "se-edu/addressbook-level3" + +plugins: + - jemoji diff --git a/docs/_data/projects.yml b/docs/_data/projects.yml new file mode 100644 index 00000000000..8f3e50cb601 --- /dev/null +++ b/docs/_data/projects.yml @@ -0,0 +1,23 @@ +- name: "AB-1" + url: https://se-edu.github.io/addressbook-level1 + +- name: "AB-2" + url: https://se-edu.github.io/addressbook-level2 + +- name: "AB-3" + url: https://se-edu.github.io/addressbook-level3 + +- name: "AB-4" + url: https://se-edu.github.io/addressbook-level4 + +- name: "Duke" + url: https://se-edu.github.io/duke + +- name: "Collate" + url: https://se-edu.github.io/collate + +- name: "Book" + url: https://se-edu.github.io/se-book + +- name: "Resources" + url: https://se-edu.github.io/resources diff --git a/docs/_includes/custom-head.html b/docs/_includes/custom-head.html new file mode 100644 index 00000000000..8559a67ffad --- /dev/null +++ b/docs/_includes/custom-head.html @@ -0,0 +1,6 @@ +{% comment %} + Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons: + + 1. Head over to https://realfavicongenerator.net/ to add your own favicons. + 2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet. +{% endcomment %} diff --git a/docs/_includes/head.html b/docs/_includes/head.html new file mode 100644 index 00000000000..8a93e7299d2 --- /dev/null +++ b/docs/_includes/head.html @@ -0,0 +1,10 @@ + + + + + + + + {%- include custom-head.html -%} + + diff --git a/docs/_includes/header.html b/docs/_includes/header.html new file mode 100644 index 00000000000..ed5a382aef7 --- /dev/null +++ b/docs/_includes/header.html @@ -0,0 +1,31 @@ + diff --git a/docs/_layouts/alt-page.html b/docs/_layouts/alt-page.html new file mode 100644 index 00000000000..5dbc6ef245f --- /dev/null +++ b/docs/_layouts/alt-page.html @@ -0,0 +1,14 @@ +--- +layout: default +--- +
+ +
+

{{ page.alt_title | escape }}

+
+ +
+ {{ content }} +
+ +
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 00000000000..e092cd572e0 --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,18 @@ + + + + {%- include head.html -%} + + + + {%- include header.html -%} + +
+
+ {{ content }} +
+
+ + + + diff --git a/docs/_layouts/page.html b/docs/_layouts/page.html new file mode 100644 index 00000000000..01e4b2a93b8 --- /dev/null +++ b/docs/_layouts/page.html @@ -0,0 +1,14 @@ +--- +layout: default +--- +
+ +
+

{{ page.title | escape }}

+
+ +
+ {{ content }} +
+ +
diff --git a/docs/_sass/minima/_base.scss b/docs/_sass/minima/_base.scss new file mode 100644 index 00000000000..06e47f23762 --- /dev/null +++ b/docs/_sass/minima/_base.scss @@ -0,0 +1,272 @@ +html { + font-size: $base-font-size; +} + +/** + * Reset some basic elements + */ +body, h1, h2, h3, h4, h5, h6, +p, blockquote, pre, hr, +dl, dd, ol, ul, figure { + margin: 0; + padding: 0; + +} + + + +/** + * Basic styling + */ +body { + font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family; + color: $text-color; + background-color: $background-color; + -webkit-text-size-adjust: 100%; + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + -o-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + font-kerning: normal; + display: flex; + min-height: 100vh; + flex-direction: column; + overflow-wrap: break-word; +} + + + +/** + * Set `margin-bottom` to maintain vertical rhythm + */ +h1, h2, h3, h4, h5, h6, +p, blockquote, pre, +ul, ol, dl, figure, +%vertical-rhythm { + margin-bottom: $spacing-unit / 2; +} + +hr { + margin-top: $spacing-unit; + margin-bottom: $spacing-unit; +} + +/** + * `main` element + */ +main { + display: block; /* Default value of `display` of `main` element is 'inline' in IE 11. */ +} + + + +/** + * Images + */ +img { + max-width: 100%; + vertical-align: middle; +} + + + +/** + * Figures + */ +figure > img { + display: block; +} + +figcaption { + font-size: $small-font-size; +} + + + +/** + * Lists + */ +ul, ol { + margin-left: $spacing-unit; +} + +li { + > ul, + > ol { + margin-bottom: 0; + } +} + + + +/** + * Headings + */ +h1, h2, h3, h4, h5, h6 { + font-weight: $base-font-weight; +} + + + +/** + * Links + */ +a { + color: $link-base-color; + text-decoration: none; + + &:visited { + color: $link-visited-color; + } + + &:hover { + color: $text-color; + text-decoration: underline; + } + + .social-media-list &:hover { + text-decoration: none; + + .username { + text-decoration: underline; + } + } +} + + +/** + * Blockquotes + */ +blockquote { + color: $brand-color; + border-left: 4px solid $brand-color-light; + padding-left: $spacing-unit / 2; + @include relative-font-size(1.125); + font-style: italic; + + > :last-child { + margin-bottom: 0; + } + + i, em { + font-style: normal; + } +} + + + +/** + * Code formatting + */ +pre, +code { + font-family: $code-font-family; + font-size: 0.9375em; + border: 1px solid $brand-color-light; + border-radius: 3px; + background-color: $code-background-color; +} + +code { + padding: 1px 5px; +} + +pre { + padding: 8px 12px; + overflow-x: auto; + + > code { + border: 0; + padding-right: 0; + padding-left: 0; + } +} + +.highlight { + border-radius: 3px; + background: $code-background-color; + @extend %vertical-rhythm; + + .highlighter-rouge & { + background: $code-background-color; + } +} + + + +/** + * Wrapper + */ +.wrapper { + max-width: calc(#{$content-width} - (#{$spacing-unit})); + margin-right: auto; + margin-left: auto; + padding-right: $spacing-unit / 2; + padding-left: $spacing-unit / 2; + @extend %clearfix; + + @media screen and (min-width: $on-large) { + max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); + padding-right: $spacing-unit; + padding-left: $spacing-unit; + } +} + + + +/** + * Clearfix + */ +%clearfix:after { + content: ""; + display: table; + clear: both; +} + + + +/** + * Icons + */ + +.orange { + color: #f66a0a; +} + +.grey { + color: #828282; +} + +/** + * Tables + */ +table { + margin-bottom: $spacing-unit; + width: 100%; + text-align: $table-text-align; + color: $table-text-color; + border-collapse: collapse; + border: 1px solid $table-border-color; + tr { + &:nth-child(even) { + background-color: $table-zebra-color; + } + } + th, td { + padding: ($spacing-unit / 3) ($spacing-unit / 2); + } + th { + background-color: $table-header-bg-color; + border: 1px solid $table-header-border; + } + td { + border: 1px solid $table-border-color; + } + + @include media-query($on-laptop) { + display: block; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } +} diff --git a/docs/_sass/minima/_layout.scss b/docs/_sass/minima/_layout.scss new file mode 100644 index 00000000000..ca99f981701 --- /dev/null +++ b/docs/_sass/minima/_layout.scss @@ -0,0 +1,263 @@ +/** + * Site header + */ +.site-header { + border-top: 5px solid $brand-color-dark; + border-bottom: 1px solid $brand-color-light; + min-height: $spacing-unit * 1.865; + line-height: $base-line-height * $base-font-size * 2.25; + + // Positioning context for the mobile navigation icon + position: relative; +} + +.site-title { + @include relative-font-size(1.625); + font-weight: 300; + letter-spacing: -1px; + margin-bottom: 0; + float: left; + + @include media-query($on-palm) { + padding-right: 45px; + } + + &, + &:visited { + color: $brand-color-dark; + } +} + +.site-nav { + position: absolute; + top: 9px; + right: $spacing-unit / 2; + background-color: $background-color; + border: 1px solid $brand-color-light; + border-radius: 5px; + text-align: right; + + .nav-trigger { + display: none; + } + + .menu-icon { + float: right; + width: 36px; + height: 26px; + line-height: 0; + padding-top: 10px; + text-align: center; + + > svg path { + fill: $brand-color-dark; + } + } + + label[for="nav-trigger"] { + display: block; + float: right; + width: 36px; + height: 36px; + z-index: 2; + cursor: pointer; + } + + input ~ .trigger { + clear: both; + display: none; + } + + input:checked ~ .trigger { + display: block; + padding-bottom: 5px; + } + + .page-link { + color: $text-color; + line-height: $base-line-height; + display: block; + padding: 5px 10px; + + // Gaps between nav items, but not on the last one + &:not(:last-child) { + margin-right: 0; + } + margin-left: 20px; + } + + @media screen and (min-width: $on-medium) { + position: static; + float: right; + border: none; + background-color: inherit; + + label[for="nav-trigger"] { + display: none; + } + + .menu-icon { + display: none; + } + + input ~ .trigger { + display: block; + } + + .page-link { + display: inline; + padding: 0; + + &:not(:last-child) { + margin-right: 20px; + } + margin-left: auto; + } + } +} + + + +/** + * Page content + */ +.page-content { + padding: $spacing-unit 0; + flex: 1 0 auto; +} + +.page-heading { + @include relative-font-size(2); +} + +.post-list-heading { + @include relative-font-size(1.75); +} + +.post-list { + margin-left: 0; + list-style: none; + + > li { + margin-bottom: $spacing-unit; + } +} + +.post-meta { + font-size: $small-font-size; + color: $brand-color; +} + +.post-link { + display: block; + @include relative-font-size(1.5); +} + + + +/** + * Posts + */ +.post-header { + margin-bottom: $spacing-unit; +} + +.post-title, +.post-content h1 { + @include relative-font-size(2.625); + letter-spacing: -1px; + line-height: 1.15; + + @media screen and (min-width: $on-large) { + @include relative-font-size(2.625); + } +} + +.post-content { + margin-bottom: $spacing-unit; + + h1, h2, h3 { margin-top: $spacing-unit * 2 } + h4, h5, h6 { margin-top: $spacing-unit } + + h2 { + @include relative-font-size(1.75); + + @media screen and (min-width: $on-large) { + @include relative-font-size(2); + } + } + + h3 { + @include relative-font-size(1.375); + + @media screen and (min-width: $on-large) { + @include relative-font-size(1.625); + } + } + + h4 { + @include relative-font-size(1.25); + } + + h5 { + @include relative-font-size(1.125); + } + h6 { + @include relative-font-size(1.0625); + } +} + + +.social-media-list { + display: table; + margin: 0 auto; + li { + float: left; + margin: 5px 10px 5px 0; + &:last-of-type { margin-right: 0 } + a { + display: block; + padding: $spacing-unit / 4; + border: 1px solid $brand-color-light; + &:hover { border-color: darken($brand-color-light, 10%) } + } + } +} + + + +/** + * Pagination navbar + */ +.pagination { + margin-bottom: $spacing-unit; + @extend .social-media-list; + li { + a, div { + min-width: 41px; + text-align: center; + box-sizing: border-box; + } + div { + display: block; + padding: $spacing-unit / 4; + border: 1px solid transparent; + + &.pager-edge { + color: darken($brand-color-light, 5%); + border: 1px dashed; + } + } + } +} + + + +/** + * Grid helpers + */ +@media screen and (min-width: $on-large) { + .one-half { + width: calc(50% - (#{$spacing-unit} / 2)); + } +} diff --git a/docs/_sass/minima/custom-mixins.scss b/docs/_sass/minima/custom-mixins.scss new file mode 100644 index 00000000000..9d4bedc1c67 --- /dev/null +++ b/docs/_sass/minima/custom-mixins.scss @@ -0,0 +1,21 @@ +@mixin alert-variant($background, $border, $color) { + color: $color; + @include gradient-bg($background); + border-color: $border; + + .alert-link { + color: darken($color, 10%); + } +} + +@mixin gradient-bg($color, $foreground: null) { + @if $enable-gradients { + @if $foreground { + background-image: $foreground, linear-gradient(180deg, mix($body-bg, $color, 15%), $color); + } @else { + background-image: linear-gradient(180deg, mix($body-bg, $color, 15%), $color); + } + } @else { + background-color: $color; + } +} diff --git a/docs/_sass/minima/custom-styles.scss b/docs/_sass/minima/custom-styles.scss new file mode 100644 index 00000000000..a992115a70f --- /dev/null +++ b/docs/_sass/minima/custom-styles.scss @@ -0,0 +1,34 @@ +// Placeholder to allow defining custom styles that override everything else. +// (Use `_sass/minima/custom-variables.scss` to override variable defaults) +h2, h3, h4, h5, h6 { + color: #e46c0a; +} + +// Bootstrap style alerts +.alert { + position: relative; + padding: $alert-padding-y $alert-padding-x; + margin-bottom: $alert-margin-bottom; + border: $alert-border-width solid transparent; + order-radius : $alert-border-radius; +} + +// Headings for larger alerts +.alert-heading { + // Specified to prevent conflicts of changing $headings-color + color: inherit; +} + +// Provide class for links that match alerts +.alert-link { + font-weight: $alert-link-font-weight; +} + +// Generate contextual modifier classes for colorizing the alert. + +@each $color, $value in $theme-colors { + .alert-#{$color} { + @include alert-variant(color-level($value, $alert-bg-level), color-level($value, $alert-border-level), color-level($value, $alert-color-level)); + } +} + diff --git a/docs/_sass/minima/custom-variables.scss b/docs/_sass/minima/custom-variables.scss new file mode 100644 index 00000000000..a128970cbe7 --- /dev/null +++ b/docs/_sass/minima/custom-variables.scss @@ -0,0 +1,76 @@ +// Placeholder to allow overriding predefined variables smoothly. + +//Bootstrap's default +$white: #fff !default; +$gray-100: #f8f9fa !default; +$gray-200: #e9ecef !default; +$gray-300: #dee2e6 !default; +$gray-400: #ced4da !default; +$gray-500: #adb5bd !default; +$gray-600: #6c757d !default; +$gray-700: #495057 !default; +$gray-800: #343a40 !default; +$gray-900: #212529 !default; +$black: #000 !default; +$blue: #0d6efd !default; +$indigo: #6610f2 !default; +$purple: #6f42c1 !default; +$pink: #d63384 !default; +$red: #dc3545 !default; +$orange: #fd7e14 !default; +$yellow: #ffc107 !default; +$green: #28a745 !default; +$teal: #20c997 !default; +$cyan: #17a2b8 !default; + +$primary: $blue !default; +$secondary: $gray-600 !default; +$success: $green !default; +$info: $cyan !default; +$warning: $yellow !default; +$danger: $red !default; +$light: $gray-100 !default; +$dark: $gray-800 !default; + +$theme-colors: ( + "primary": $primary, + "secondary": $secondary, + "success": $success, + "info": $info, + "warning": $warning, + "danger": $danger, + "light": $light, + "dark": $dark +) !default; + +$theme-color-interval: 8% !default; + +$body-bg: $white !default; +$body-color: $gray-900 !default; +$body-text-align: null !default; + +$enable-gradients: true; + +// Define alert colors, border radius, and padding. +$border-radius: .25rem !default; +$border-width: 1px !default; +$font-weight-bold: 700 !default; + +$alert-padding-y: .75rem !default; +$alert-padding-x: 1.25rem !default; +$alert-margin-bottom: 1rem !default; +$alert-border-radius: $border-radius !default; +$alert-link-font-weight: $font-weight-bold !default; +$alert-border-width: $border-width !default; + +$alert-bg-level: -10 !default; +$alert-border-level: -9 !default; +$alert-color-level: 6 !default; + +// Request a color level +// scss-docs-start color-level +@function color-level($color: $primary, $level: 0) { + $color-base: if($level > 0, $black, $white); + $level: abs($level); + @return mix($color-base, $color, $level * $theme-color-interval); +} diff --git a/docs/_sass/minima/initialize.scss b/docs/_sass/minima/initialize.scss new file mode 100644 index 00000000000..30288811151 --- /dev/null +++ b/docs/_sass/minima/initialize.scss @@ -0,0 +1,51 @@ +@charset "utf-8"; + +// Define defaults for each variable. + +$base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Symbol", "Segoe UI Emoji", "Apple Color Emoji", Roboto, Helvetica, Arial, sans-serif !default; +$code-font-family: "Menlo", "Inconsolata", "Consolas", "Roboto Mono", "Ubuntu Mono", "Liberation Mono", "Courier New", monospace; +$base-font-size: 16px !default; +$base-font-weight: 400 !default; +$small-font-size: $base-font-size * 0.875 !default; +$base-line-height: 1.5 !default; + +$spacing-unit: 30px !default; + +$table-text-align: left !default; + +// Width of the content area +$content-width: 800px !default; + +$on-palm: 600px !default; +$on-laptop: 800px !default; + +$on-medium: $on-palm !default; +$on-large: $on-laptop !default; + +// Use media queries like this: +// @include media-query($on-palm) { +// .wrapper { +// padding-right: $spacing-unit / 2; +// padding-left: $spacing-unit / 2; +// } +// } +// Notice the following mixin uses max-width, in a deprecated, desktop-first +// approach, whereas media queries used elsewhere now use min-width. +@mixin media-query($device) { + @media screen and (max-width: $device) { + @content; + } +} + +@mixin relative-font-size($ratio) { + font-size: #{$ratio}rem; +} + +// Import pre-styling-overrides hook and style-partials. +@import + "minima/custom-variables", // Hook to override predefined variables. + "minima/custom-mixins", // Hook to add custom mixins. + "minima/base", // Defines element resets. + "minima/layout", // Defines structure and style based on CSS selectors. + "minima/custom-styles" // Hook to override existing styles. +; diff --git a/docs/_sass/minima/skins/classic.scss b/docs/_sass/minima/skins/classic.scss new file mode 100644 index 00000000000..37ea9c5244c --- /dev/null +++ b/docs/_sass/minima/skins/classic.scss @@ -0,0 +1,84 @@ +@charset "utf-8"; + +$brand-color: #828282 !default; +$brand-color-light: lighten($brand-color, 40%) !default; +$brand-color-dark: darken($brand-color, 25%) !default; + +$text-color: #111 !default; +$background-color: #fdfdfd !default; +$code-background-color: #eef !default; + +$link-base-color: #2a7ae2 !default; +$link-visited-color: darken($link-base-color, 15%) !default; + +$table-text-color: lighten($text-color, 18%) !default; +$table-zebra-color: lighten($brand-color, 46%) !default; +$table-header-bg-color: lighten($brand-color, 43%) !default; +$table-header-border: lighten($brand-color, 36%) !default; +$table-border-color: $brand-color-light !default; + + +// Syntax highlighting styles should be adjusted appropriately for every "skin" +// ---------------------------------------------------------------------------- + +.highlight { + .c { color: #998; font-style: italic } // Comment + .err { color: #a61717; background-color: #e3d2d2 } // Error + .k { font-weight: bold } // Keyword + .o { font-weight: bold } // Operator + .cm { color: #998; font-style: italic } // Comment.Multiline + .cp { color: #999; font-weight: bold } // Comment.Preproc + .c1 { color: #998; font-style: italic } // Comment.Single + .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special + .gd { color: #000; background-color: #fdd } // Generic.Deleted + .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific + .ge { font-style: italic } // Generic.Emph + .gr { color: #a00 } // Generic.Error + .gh { color: #999 } // Generic.Heading + .gi { color: #000; background-color: #dfd } // Generic.Inserted + .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific + .go { color: #888 } // Generic.Output + .gp { color: #555 } // Generic.Prompt + .gs { font-weight: bold } // Generic.Strong + .gu { color: #aaa } // Generic.Subheading + .gt { color: #a00 } // Generic.Traceback + .kc { font-weight: bold } // Keyword.Constant + .kd { font-weight: bold } // Keyword.Declaration + .kp { font-weight: bold } // Keyword.Pseudo + .kr { font-weight: bold } // Keyword.Reserved + .kt { color: #458; font-weight: bold } // Keyword.Type + .m { color: #099 } // Literal.Number + .s { color: #d14 } // Literal.String + .na { color: #008080 } // Name.Attribute + .nb { color: #0086B3 } // Name.Builtin + .nc { color: #458; font-weight: bold } // Name.Class + .no { color: #008080 } // Name.Constant + .ni { color: #800080 } // Name.Entity + .ne { color: #900; font-weight: bold } // Name.Exception + .nf { color: #900; font-weight: bold } // Name.Function + .nn { color: #555 } // Name.Namespace + .nt { color: #000080 } // Name.Tag + .nv { color: #008080 } // Name.Variable + .ow { font-weight: bold } // Operator.Word + .w { color: #bbb } // Text.Whitespace + .mf { color: #099 } // Literal.Number.Float + .mh { color: #099 } // Literal.Number.Hex + .mi { color: #099 } // Literal.Number.Integer + .mo { color: #099 } // Literal.Number.Oct + .sb { color: #d14 } // Literal.String.Backtick + .sc { color: #d14 } // Literal.String.Char + .sd { color: #d14 } // Literal.String.Doc + .s2 { color: #d14 } // Literal.String.Double + .se { color: #d14 } // Literal.String.Escape + .sh { color: #d14 } // Literal.String.Heredoc + .si { color: #d14 } // Literal.String.Interpol + .sx { color: #d14 } // Literal.String.Other + .sr { color: #009926 } // Literal.String.Regex + .s1 { color: #d14 } // Literal.String.Single + .ss { color: #990073 } // Literal.String.Symbol + .bp { color: #999 } // Name.Builtin.Pseudo + .vc { color: #008080 } // Name.Variable.Class + .vg { color: #008080 } // Name.Variable.Global + .vi { color: #008080 } // Name.Variable.Instance + .il { color: #099 } // Literal.Number.Integer.Long +} diff --git a/docs/_sass/minima/skins/solarized-dark.scss b/docs/_sass/minima/skins/solarized-dark.scss new file mode 100644 index 00000000000..f3b1f387de0 --- /dev/null +++ b/docs/_sass/minima/skins/solarized-dark.scss @@ -0,0 +1,4 @@ +@charset "utf-8"; + +$sol-is-dark: true; +@import "minima/skins/solarized"; diff --git a/docs/_sass/minima/skins/solarized.scss b/docs/_sass/minima/skins/solarized.scss new file mode 100644 index 00000000000..982bd7f2990 --- /dev/null +++ b/docs/_sass/minima/skins/solarized.scss @@ -0,0 +1,133 @@ +@charset "utf-8"; + +// Solarized skin +// ============== +// Created by Sander Voerman using the Solarized +// color scheme by Ethan Schoonover . + +// This style sheet implements two options for the minima.skin setting: +// "solarized" for light mode and "solarized-dark" for dark mode. +$sol-is-dark: false !default; + + +// Color scheme +// ------------ +// The inline comments show the canonical L*a*b values for each color. + +$sol-base03: #002b36; // 15 -12 -12 +$sol-base02: #073642; // 20 -12 -12 +$sol-base01: #586e75; // 45 -07 -07 +$sol-base00: #657b83; // 50 -07 -07 +$sol-base0: #839496; // 60 -06 -03 +$sol-base1: #93a1a1; // 65 -05 -02 +$sol-base2: #eee8d5; // 92 -00 10 +$sol-base3: #fdf6e3; // 97 00 10 +$sol-yellow: #b58900; // 60 10 65 +$sol-orange: #cb4b16; // 50 50 55 +$sol-red: #dc322f; // 50 65 45 +$sol-magenta: #d33682; // 50 65 -05 +$sol-violet: #6c71c4; // 50 15 -45 +$sol-blue: #268bd2; // 55 -10 -45 +$sol-cyan: #2aa198; // 60 -35 -05 +$sol-green: #859900; // 60 -20 65 + +$sol-mono3: $sol-base3; +$sol-mono2: $sol-base2; +$sol-mono1: $sol-base1; +$sol-mono00: $sol-base00; +$sol-mono01: $sol-base01; + +@if $sol-is-dark { + $sol-mono3: $sol-base03; + $sol-mono2: $sol-base02; + $sol-mono1: $sol-base01; + $sol-mono00: $sol-base0; + $sol-mono01: $sol-base1; +} + + +// Minima color variables +// ---------------------- + +$brand-color: $sol-mono1 !default; +$brand-color-light: mix($sol-mono1, $sol-mono3) !default; +$brand-color-dark: $sol-mono00 !default; + +$text-color: $sol-mono01 !default; +$background-color: $sol-mono3 !default; +$code-background-color: $sol-mono2 !default; + +$link-base-color: $sol-blue !default; +$link-visited-color: mix($sol-blue, $sol-mono00) !default; + +$table-text-color: $sol-mono00 !default; +$table-zebra-color: mix($sol-mono2, $sol-mono3) !default; +$table-header-bg-color: $sol-mono2 !default; +$table-header-border: $sol-mono1 !default; +$table-border-color: $sol-mono1 !default; + + +// Syntax highlighting styles +// -------------------------- + +.highlight { + .c { color: $sol-mono1; font-style: italic } // Comment + .err { color: $sol-red } // Error + .k { color: $sol-mono01; font-weight: bold } // Keyword + .o { color: $sol-mono01; font-weight: bold } // Operator + .cm { color: $sol-mono1; font-style: italic } // Comment.Multiline + .cp { color: $sol-mono1; font-weight: bold } // Comment.Preproc + .c1 { color: $sol-mono1; font-style: italic } // Comment.Single + .cs { color: $sol-mono1; font-weight: bold; font-style: italic } // Comment.Special + .gd { color: $sol-red } // Generic.Deleted + .gd .x { color: $sol-red } // Generic.Deleted.Specific + .ge { color: $sol-mono00; font-style: italic } // Generic.Emph + .gr { color: $sol-red } // Generic.Error + .gh { color: $sol-mono1 } // Generic.Heading + .gi { color: $sol-green } // Generic.Inserted + .gi .x { color: $sol-green } // Generic.Inserted.Specific + .go { color: $sol-mono00 } // Generic.Output + .gp { color: $sol-mono00 } // Generic.Prompt + .gs { color: $sol-mono01; font-weight: bold } // Generic.Strong + .gu { color: $sol-mono1 } // Generic.Subheading + .gt { color: $sol-red } // Generic.Traceback + .kc { color: $sol-mono01; font-weight: bold } // Keyword.Constant + .kd { color: $sol-mono01; font-weight: bold } // Keyword.Declaration + .kp { color: $sol-mono01; font-weight: bold } // Keyword.Pseudo + .kr { color: $sol-mono01; font-weight: bold } // Keyword.Reserved + .kt { color: $sol-violet; font-weight: bold } // Keyword.Type + .m { color: $sol-cyan } // Literal.Number + .s { color: $sol-magenta } // Literal.String + .na { color: $sol-cyan } // Name.Attribute + .nb { color: $sol-blue } // Name.Builtin + .nc { color: $sol-violet; font-weight: bold } // Name.Class + .no { color: $sol-cyan } // Name.Constant + .ni { color: $sol-violet } // Name.Entity + .ne { color: $sol-violet; font-weight: bold } // Name.Exception + .nf { color: $sol-blue; font-weight: bold } // Name.Function + .nn { color: $sol-mono00 } // Name.Namespace + .nt { color: $sol-blue } // Name.Tag + .nv { color: $sol-cyan } // Name.Variable + .ow { color: $sol-mono01; font-weight: bold } // Operator.Word + .w { color: $sol-mono1 } // Text.Whitespace + .mf { color: $sol-cyan } // Literal.Number.Float + .mh { color: $sol-cyan } // Literal.Number.Hex + .mi { color: $sol-cyan } // Literal.Number.Integer + .mo { color: $sol-cyan } // Literal.Number.Oct + .sb { color: $sol-magenta } // Literal.String.Backtick + .sc { color: $sol-magenta } // Literal.String.Char + .sd { color: $sol-magenta } // Literal.String.Doc + .s2 { color: $sol-magenta } // Literal.String.Double + .se { color: $sol-magenta } // Literal.String.Escape + .sh { color: $sol-magenta } // Literal.String.Heredoc + .si { color: $sol-magenta } // Literal.String.Interpol + .sx { color: $sol-magenta } // Literal.String.Other + .sr { color: $sol-green } // Literal.String.Regex + .s1 { color: $sol-magenta } // Literal.String.Single + .ss { color: $sol-magenta } // Literal.String.Symbol + .bp { color: $sol-mono1 } // Name.Builtin.Pseudo + .vc { color: $sol-cyan } // Name.Variable.Class + .vg { color: $sol-cyan } // Name.Variable.Global + .vi { color: $sol-cyan } // Name.Variable.Instance + .il { color: $sol-cyan } // Literal.Number.Integer.Long +} diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss new file mode 100644 index 00000000000..0d1fce9fbbe --- /dev/null +++ b/docs/assets/css/style.scss @@ -0,0 +1,7 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- + +@import + "minima/skins/{{ site.minima.skin | default: 'classic' }}", + "minima/initialize"; diff --git a/docs/diagrams/ArchitectureDiagram.puml b/docs/diagrams/ArchitectureDiagram.puml index d021b3992ed..a929d8e40b3 100644 --- a/docs/diagrams/ArchitectureDiagram.puml +++ b/docs/diagrams/ArchitectureDiagram.puml @@ -9,34 +9,23 @@ Package " "<>{ Class Logic LOGIC_COLOR Class Storage STORAGE_COLOR Class Model MODEL_COLOR - Class Main MODEL_COLOR_T1 + Class Main #grey Class Commons LOGIC_COLOR_T2 - Class "Log Center" as Logs UI_COLOR_T2 - Class Hidden #FFFFFF - Class HiddenUI #FFFFFF - Class HiddenModel #FFFFFF - - } + Class "<$user>" as User MODEL_COLOR_T2 Class "<$documents>" as File UI_COLOR_T1 -HiddenUI -up[hidden]-> UI -HiddenModel -left[hidden]-> Model -Main -up-> HiddenUI -Main -left-> HiddenModel -UI -> Logic -UI -right-> Model -Logic -> Storage -Logic -down-> Model - -Logs -right- Commons -Hidden .down.> Commons -Hidden .down.> Commons -Hidden .down.> Commons +UI -[#green]> Logic +UI -right[#green]-> Model +Logic -[#blue]-> Storage +Logic -down[#blue]-> Model +Main -[#grey]-> UI +Main -[#grey]-> Logic +Main -[#grey]-> Storage +Main -up[#grey]-> Model -Storage .right.>File -User --> UI -Main --> Hidden +Storage .right[STORAGE_COLOR].>File +User ..> UI @enduml diff --git a/docs/diagrams/BetterModelClassDiagram.puml b/docs/diagrams/BetterModelClassDiagram.puml index 7790472da52..29076104af3 100644 --- a/docs/diagrams/BetterModelClassDiagram.puml +++ b/docs/diagrams/BetterModelClassDiagram.puml @@ -12,7 +12,7 @@ UniqueTagList -[hidden]down- UniquePersonList UniqueTagList *-right-> "*" Tag UniquePersonList o-right-> Person -Person o-up-> "*" Tag +Person -up-> "*" Tag Person *--> Name Person *--> Phone diff --git a/docs/images/ArchitectureDiagram.png b/docs/images/ArchitectureDiagram.png index aa2d337d932..5cdcf67e747 100644 Binary files a/docs/images/ArchitectureDiagram.png and b/docs/images/ArchitectureDiagram.png differ diff --git a/docs/images/checkstyle/runCheckstyle.png b/docs/images/checkstyle/runCheckstyle.png new file mode 100644 index 00000000000..dc8217aabef Binary files /dev/null and b/docs/images/checkstyle/runCheckstyle.png differ diff --git a/docs/images/findAlexDavidResult.png b/docs/images/findAlexDavidResult.png new file mode 100644 index 00000000000..235da1c273e Binary files /dev/null and b/docs/images/findAlexDavidResult.png differ diff --git a/docs/images/helpMessage.png b/docs/images/helpMessage.png new file mode 100644 index 00000000000..b1f70470137 Binary files /dev/null and b/docs/images/helpMessage.png differ diff --git a/docs/images/intellijCodeStyle-switch.png b/docs/images/intellijCodeStyle-switch.png new file mode 100644 index 00000000000..a8a43738e2c Binary files /dev/null and b/docs/images/intellijCodeStyle-switch.png differ diff --git a/docs/index.adoc b/docs/index.adoc deleted file mode 100644 index a65ae663288..00000000000 --- a/docs/index.adoc +++ /dev/null @@ -1,2 +0,0 @@ -:stylesDir: stylesheets -include::../README.adoc[] diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000000..db4b3f9f90f --- /dev/null +++ b/docs/index.md @@ -0,0 +1,18 @@ +--- +layout: page +title: AddressBook Level-3 +--- + +[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) + +![Ui](images/Ui.png) + +**AddressBook is a desktop application for managing your contact details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface). + +* If you are interested in using AddressBook, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start). +* If you are interested about developing AddressBook, the [**Developer Guide**](DeveloperGuide.html) is a good place to start. + + +**Acknowledgements** + +* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5) diff --git a/docs/stylesheets/asciidoctor.css b/docs/stylesheets/asciidoctor.css deleted file mode 100644 index 36590bf346c..00000000000 --- a/docs/stylesheets/asciidoctor.css +++ /dev/null @@ -1,407 +0,0 @@ -/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */ -/* Remove comment around @import statement below when using as a custom stylesheet */ -/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block} -audio,canvas,video{display:inline-block} -audio:not([controls]){display:none;height:0} -[hidden],template{display:none} -script{display:none!important} -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%} -body{margin:0} -a{background:transparent} -a:focus{outline:thin dotted} -a:active,a:hover{outline:0} -h1{font-size:2em;margin:.67em 0} -abbr[title]{border-bottom:1px dotted} -b,strong{font-weight:bold} -dfn{font-style:italic} -hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0} -mark{background:#ff0;color:#000} -code,kbd,pre,samp{font-family:monospace;font-size:1em} -pre{white-space:pre-wrap} -q{quotes:"\201C" "\201D" "\2018" "\2019"} -small{font-size:80%} -sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} -sup{top:-.5em} -sub{bottom:-.25em} -img{border:0} -svg:not(:root){overflow:hidden} -figure{margin:0} -fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em} -legend{border:0;padding:0} -button,input,select,textarea{font-family:inherit;font-size:100%;margin:0} -button,input{line-height:normal} -button,select{text-transform:none} -button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer} -button[disabled],html input[disabled]{cursor:default} -input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0} -input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box} -input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none} -button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} -textarea{overflow:auto;vertical-align:top} -table{border-collapse:collapse;border-spacing:0} -*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box} -html,body{font-size:100%} -body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto} -a:hover{cursor:pointer} -img,object,embed{max-width:100%;height:auto} -object,embed{height:100%} -img{-ms-interpolation-mode:bicubic} -.left{float:left!important} -.right{float:right!important} -.text-left{text-align:left!important} -.text-right{text-align:right!important} -.text-center{text-align:center!important} -.text-justify{text-align:justify!important} -.hide{display:none} -body{-webkit-font-smoothing:antialiased} -img,object,svg{display:inline-block;vertical-align:middle} -textarea{height:auto;min-height:50px} -select{width:100%} -.center{margin-left:auto;margin-right:auto} -.spread{width:100%} -p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6} -.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em} -div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr} -a{color:#2156a5;text-decoration:underline;line-height:inherit} -a:hover,a:focus{color:#1d4b8f} -a img{border:none} -p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility} -p aside{font-size:.875em;line-height:1.35;font-style:italic} -h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} -h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0} -h1{font-size:2.125em} -h2{font-size:1.6875em} -h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em} -h4,h5{font-size:1.125em} -h6{font-size:1em} -hr{border:solid #ddddd8;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0} -em,i{font-style:italic;line-height:inherit} -strong,b{font-weight:bold;line-height:inherit} -small{font-size:60%;line-height:inherit} -code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)} -ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit} -ul,ol,ul.no-bullet,ol.no-bullet{margin-left:1.5em} -ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em} -ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit} -ul.square{list-style-type:square} -ul.circle{list-style-type:circle} -ul.disc{list-style-type:disc} -ul.no-bullet{list-style:none} -ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0} -dl dt{margin-bottom:.3125em;font-weight:bold} -dl dd{margin-bottom:1.25em} -abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help} -abbr{text-transform:none} -blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd} -blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)} -blockquote cite:before{content:"\2014 \0020"} -blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)} -blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)} -@media only screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2} -h1{font-size:2.75em} -h2{font-size:2.3125em} -h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em} -h4{font-size:1.4375em}} -table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede} -table thead,table tfoot{background:#f7f8f7;font-weight:bold} -table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left} -table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)} -table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7} -table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6} -body{tab-size:4} -h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em} -h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400} -.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table} -.clearfix:after,.float-group:after{clear:both} -*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed} -pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed} -.keyseq{color:rgba(51,51,51,.8)} -kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap} -.keyseq kbd:first-child{margin-left:0} -.keyseq kbd:last-child{margin-right:0} -.menuseq,.menu{color:rgba(0,0,0,.8)} -b.button:before,b.button:after{position:relative;top:-1px;font-weight:400} -b.button:before{content:"[";padding:0 3px 0 2px} -b.button:after{content:"]";padding:0 2px 0 3px} -p a>code:hover{color:rgba(0,0,0,.9)} -#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em} -#header:before,#header:after,#content:before,#content:after,#footnotes:before,#footnotes:after,#footer:before,#footer:after{content:" ";display:table} -#header:after,#content:after,#footnotes:after,#footer:after{clear:both} -#content{margin-top:1.25em} -#content:before{content:none} -#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0} -#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8} -#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px} -#header .details{border-bottom:1px solid #ddddd8;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap} -#header .details span:first-child{margin-left:-.125em} -#header .details span.email a{color:rgba(0,0,0,.85)} -#header .details br{display:none} -#header .details br+span:before{content:"\00a0\2013\00a0"} -#header .details br+span.author:before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)} -#header .details br+span#revremark:before{content:"\00a0|\00a0"} -#header #revnumber{text-transform:capitalize} -#header #revnumber:after{content:"\00a0"} -#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem} -#toc{border-bottom:1px solid #efefed;padding-bottom:.5em} -#toc>ul{margin-left:.125em} -#toc ul.sectlevel0>li>a{font-style:italic} -#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0} -#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none} -#toc li{line-height:1.3334;margin-top:.3334em} -#toc a{text-decoration:none} -#toc a:active{text-decoration:underline} -#toctitle{color:#7a2518;font-size:1.2em} -@media only screen and (min-width:768px){#toctitle{font-size:1.375em} -body.toc2{padding-left:15em;padding-right:0} -#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto} -#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em} -#toc.toc2>ul{font-size:.9em;margin-bottom:0} -#toc.toc2 ul ul{margin-left:0;padding-left:1em} -#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em} -body.toc2.toc-right{padding-left:0;padding-right:15em} -body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}} -@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0} -#toc.toc2{width:20em} -#toc.toc2 #toctitle{font-size:1.375em} -#toc.toc2>ul{font-size:.95em} -#toc.toc2 ul ul{padding-left:1.25em} -body.toc2.toc-right{padding-left:0;padding-right:20em}} -#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px} -#content #toc>:first-child{margin-top:0} -#content #toc>:last-child{margin-bottom:0} -#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em} -#footer-text{color:rgba(255,255,255,.8);line-height:1.44} -.sect1{padding-bottom:.625em} -@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}} -.sect1+.sect1{border-top:1px solid #efefed} -#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400} -#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em} -#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible} -#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none} -#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221} -.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em} -.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic} -table.tableblock>caption.title{white-space:nowrap;overflow:visible;max-width:0} -.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{color:rgba(0,0,0,.85)} -table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inherit} -.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%} -.admonitionblock>table td.icon{text-align:center;width:80px} -.admonitionblock>table td.icon img{max-width:none} -.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase} -.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)} -.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} -.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px} -.exampleblock>.content>:first-child{margin-top:0} -.exampleblock>.content>:last-child{margin-bottom:0} -.sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px} -.sidebarblock>:first-child{margin-top:0} -.sidebarblock>:last-child{margin-bottom:0} -.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center} -.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} -.literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8} -.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1} -.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em} -.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal} -@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}} -@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}} -.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)} -.listingblock pre.highlightjs{padding:0} -.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px} -.listingblock pre.prettyprint{border-width:0} -.listingblock>.content{position:relative} -.listingblock code[data-lang]:before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999} -.listingblock:hover code[data-lang]:before{display:block} -.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999} -.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"} -table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none} -table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45} -table.pyhltable td.code{padding-left:.75em;padding-right:0} -pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8} -pre.pygments .lineno{display:inline-block;margin-right:.25em} -table.pyhltable .linenodiv{background:none!important;padding-right:0!important} -.quoteblock{margin:0 1em 1.25em 1.5em;display:table} -.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em} -.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify} -.quoteblock blockquote{margin:0;padding:0;border:0} -.quoteblock blockquote:before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)} -.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0} -.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right} -.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)} -.quoteblock .quoteblock blockquote{padding:0 0 0 .75em} -.quoteblock .quoteblock blockquote:before{display:none} -.verseblock{margin:0 1em 1.25em 1em} -.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility} -.verseblock pre strong{font-weight:400} -.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex} -.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic} -.quoteblock .attribution br,.verseblock .attribution br{display:none} -.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)} -.quoteblock.abstract{margin:0 0 1.25em 0;display:block} -.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0} -.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none} -table.tableblock{max-width:100%;border-collapse:separate} -table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0} -table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede} -table.grid-all th.tableblock,table.grid-all td.tableblock{border-width:0 1px 1px 0} -table.grid-all tfoot>tr>th.tableblock,table.grid-all tfoot>tr>td.tableblock{border-width:1px 1px 0 0} -table.grid-cols th.tableblock,table.grid-cols td.tableblock{border-width:0 1px 0 0} -table.grid-all *>tr>.tableblock:last-child,table.grid-cols *>tr>.tableblock:last-child{border-right-width:0} -table.grid-rows th.tableblock,table.grid-rows td.tableblock{border-width:0 0 1px 0} -table.grid-all tbody>tr:last-child>th.tableblock,table.grid-all tbody>tr:last-child>td.tableblock,table.grid-all thead:last-child>tr>th.tableblock,table.grid-rows tbody>tr:last-child>th.tableblock,table.grid-rows tbody>tr:last-child>td.tableblock,table.grid-rows thead:last-child>tr>th.tableblock{border-bottom-width:0} -table.grid-rows tfoot>tr>th.tableblock,table.grid-rows tfoot>tr>td.tableblock{border-width:1px 0 0 0} -table.frame-all{border-width:1px} -table.frame-sides{border-width:0 1px} -table.frame-topbot{border-width:1px 0} -th.halign-left,td.halign-left{text-align:left} -th.halign-right,td.halign-right{text-align:right} -th.halign-center,td.halign-center{text-align:center} -th.valign-top,td.valign-top{vertical-align:top} -th.valign-bottom,td.valign-bottom{vertical-align:bottom} -th.valign-middle,td.valign-middle{vertical-align:middle} -table thead th,table tfoot th{font-weight:bold} -tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7} -tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold} -p.tableblock>code:only-child{background:none;padding:0} -p.tableblock{font-size:1em} -td>div.verse{white-space:pre} -ol{margin-left:1.75em} -ul li ol{margin-left:1.5em} -dl dd{margin-left:1.125em} -dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0} -ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em} -ul.unstyled,ol.unnumbered,ul.checklist,ul.none{list-style-type:none} -ul.unstyled,ol.unnumbered,ul.checklist{margin-left:.625em} -ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1em;font-size:.85em} -ul.checklist li>p:first-child>input[type="checkbox"]:first-child{width:1em;position:relative;top:1px} -ul.inline{margin:0 auto .625em auto;margin-left:-1.375em;margin-right:0;padding:0;list-style:none;overflow:hidden} -ul.inline>li{list-style:none;float:left;margin-left:1.375em;display:block} -ul.inline>li>*{display:block} -.unstyled dl dt{font-weight:400;font-style:normal} -ol.arabic{list-style-type:decimal} -ol.decimal{list-style-type:decimal-leading-zero} -ol.loweralpha{list-style-type:lower-alpha} -ol.upperalpha{list-style-type:upper-alpha} -ol.lowerroman{list-style-type:lower-roman} -ol.upperroman{list-style-type:upper-roman} -ol.lowergreek{list-style-type:lower-greek} -.hdlist>table,.colist>table{border:0;background:none} -.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none} -td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em} -td.hdlist1{font-weight:bold;padding-bottom:1.25em} -.literalblock+.colist,.listingblock+.colist{margin-top:-.5em} -.colist>table tr>td:first-of-type{padding:0 .75em;line-height:1} -.colist>table tr>td:last-of-type{padding:.25em 0} -.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd} -.imageblock.left,.imageblock[style*="float: left"]{margin:.25em .625em 1.25em 0} -.imageblock.right,.imageblock[style*="float: right"]{margin:.25em 0 1.25em .625em} -.imageblock>.title{margin-bottom:0} -.imageblock.thumb,.imageblock.th{border-width:6px} -.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em} -.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0} -.image.left{margin-right:.625em} -.image.right{margin-left:.625em} -a.image{text-decoration:none;display:inline-block} -a.image object{pointer-events:none} -sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super} -sup.footnote a,sup.footnoteref a{text-decoration:none} -sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline} -#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em} -#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0} -#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em} -#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none} -#footnotes .footnote:last-of-type{margin-bottom:0} -#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0} -.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0} -.gist .file-data>table td.line-data{width:99%} -div.unbreakable{page-break-inside:avoid} -.big{font-size:larger} -.small{font-size:smaller} -.underline{text-decoration:underline} -.overline{text-decoration:overline} -.line-through{text-decoration:line-through} -.aqua{color:#00bfbf} -.aqua-background{background-color:#00fafa} -.black{color:#000} -.black-background{background-color:#000} -.blue{color:#0000bf} -.blue-background{background-color:#0000fa} -.fuchsia{color:#bf00bf} -.fuchsia-background{background-color:#fa00fa} -.gray{color:#606060} -.gray-background{background-color:#7d7d7d} -.green{color:#006000} -.green-background{background-color:#007d00} -.lime{color:#00bf00} -.lime-background{background-color:#00fa00} -.maroon{color:#600000} -.maroon-background{background-color:#7d0000} -.navy{color:#000060} -.navy-background{background-color:#00007d} -.olive{color:#606000} -.olive-background{background-color:#7d7d00} -.purple{color:#600060} -.purple-background{background-color:#7d007d} -.red{color:#bf0000} -.red-background{background-color:#fa0000} -.silver{color:#909090} -.silver-background{background-color:#bcbcbc} -.teal{color:#006060} -.teal-background{background-color:#007d7d} -.white{color:#bfbfbf} -.white-background{background-color:#fafafa} -.yellow{color:#bfbf00} -.yellow-background{background-color:#fafa00} -span.icon>.fa{cursor:default} -.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default} -.admonitionblock td.icon .icon-note:before{content:"\f05a";color:#19407c} -.admonitionblock td.icon .icon-tip:before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111} -.admonitionblock td.icon .icon-warning:before{content:"\f071";color:#bf6900} -.admonitionblock td.icon .icon-caution:before{content:"\f06d";color:#bf3400} -.admonitionblock td.icon .icon-important:before{content:"\f06a";color:#bf0000} -.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} -.conum[data-value] *{color:#fff!important} -.conum[data-value]+b{display:none} -.conum[data-value]:after{content:attr(data-value)} -pre .conum[data-value]{position:relative;top:-.125em} -b.conum *{color:inherit!important} -.conum:not([data-value]):empty{display:none} -dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} -h1,h2,p,td.content,span.alt{letter-spacing:-.01em} -p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} -p,blockquote,dt,td.content,span.alt{font-size:1.0625rem} -p{margin-bottom:1.25rem} -.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} -.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc} -.print-only{display:none!important} -@media print{@page{margin:1.25cm .75cm} -*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important} -a{color:inherit!important;text-decoration:underline!important} -a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important} -a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em} -abbr[title]:after{content:" (" attr(title) ")"} -pre,blockquote,tr,img,object,svg{page-break-inside:avoid} -thead{display:table-header-group} -svg{max-width:100%} -p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3} -h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid} -#toc,.sidebarblock,.exampleblock>.content{background:none!important} -#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important} -.sect1{padding-bottom:0!important} -.sect1+.sect1{border:0!important} -#header>h1:first-child{margin-top:1.25rem} -body.book #header{text-align:center} -body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em 0} -body.book #header .details{border:0!important;display:block;padding:0!important} -body.book #header .details span:first-child{margin-left:0!important} -body.book #header .details br{display:block} -body.book #header .details br+span:before{content:none!important} -body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important} -body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always} -.listingblock code[data-lang]:before{display:block} -#footer{background:none!important;padding:0 .9375em} -#footer-text{color:rgba(0,0,0,.6)!important;font-size:.9em} -.hide-on-print{display:none!important} -.print-only{display:block!important} -.hide-for-print{display:none!important} -.show-for-print{display:inherit!important}} diff --git a/docs/stylesheets/gh-pages.css b/docs/stylesheets/gh-pages.css deleted file mode 100644 index 121cac3885f..00000000000 --- a/docs/stylesheets/gh-pages.css +++ /dev/null @@ -1,214 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Montserrat|Open+Sans); -@import "asciidoctor.css"; /* Default asciidoc style framework - important */ - -/* Custom block: details */ - -.sidebarblock.details > .content { - border-left: .25rem solid rgba(0, 0, 0, 0.1); -} - -.sidebarblock.details > .content { - padding-left: .5rem -} - -.sidebarblock.details { - background-color: transparent; - border: none; - padding-bottom: 0; - padding-top: 0; -} - -/* Overrides for asciidoctor.css */ - -a { - color: #0074c7; -} - -h1, -#content h1 > a.link, -h2, -h2 > a.link, -h3, -h3 > a.link, -#toctitle, -#toctitle > a.link, -.sidebarblock > .content > .title, -.sidebarblock > .content > .title > a.link, -h4, -h4 > a.link, -h5, -h5 > a.link, -h6, -h6 > a.link { - color: #e46c0a; -} - -.subheader, -.admonitionblock td.content > .title, -.audioblock > .title, -.exampleblock > .title, -.imageblock > .title, -.listingblock > .title, -.literalblock > .title, -.stemblock > .title, -.openblock > .title, -.paragraph >.title, -.quoteblock > .title, -table.tableblock > .title, -.verseblock > .title, -.videoblock > .title, -.dlist > .title, -.olist > .title, -.ulist > .title, -.qlist > .title, -.hdlist > .title { - color: rgb(197, 90, 17); -} - -@media screen { - #footer { - background-color: #f6f6f6; - border-top: 1px #d2d2d2 solid; - border-bottom: 1px #d2d2d2 solid; - font-family: "Open Sans", "DejaVu Sans", sans-serif; - } - - #footer-text { - color: #595959; - line-height: 1; - } -} - -/* Utilities */ - -.container { - width: 100%; - max-width: 62.5rem; - margin-left: auto; - margin-right: auto; -} - -/* Colors */ - -.bg-light { - background-color: #f8f9fa; -} - -.bg-lighter { - background-color: #fbfbfb; -} - - -/* Navbar */ - -.navbar { - display: flex; - flex-wrap: nowrap; - justify-content: center; - font-family: "Open Sans", "DejaVu Sans", sans-serif; - font-size: 1rem; - padding: 0px 1rem; -} - -.navbar-lg { - font-size: 1.3rem; -} - -.navbar-light { - border-bottom: 1px #d2d2d2 solid; -} - -.navbar a { - text-decoration: none; -} - -.navbar-light a { - color: #595959; -} - -.navbar-light a:hover, -.navbar-light a:focus { - color: #000000; -} - -.navbar a.active, -.navbar a.active:hover, -.navbar a.active:focus { - font-weight: bold; -} - -.navbar-light a.active, -.navbar-light a.active:hover, -.navbar-light a.active:focus { - color: #000000; -} - -.navbar-light .nav-link { - border-bottom: 2px transparent solid; -} - -.navbar-light .nav-link.active { - border-bottom: 2px #e46c0a solid; -} - -.navbar-lg .nav-link.active { - border-bottom: 0; -} - -.navbar > .container { - display: flex; - flex-wrap: wrap; - justify-content: center; -} - -.navbar-brand { - display: inline-block; - margin-right: 1rem; - padding: 0.8125rem 0rem; - padding-left: 0.9375rem; - font-size: 1.25rem; -} - -.navbar-brand img { - height: 1.4rem; - margin: 0rem 0.4rem; - padding: 0; - vertical-align: middle; -} - -.navbar-lg .navbar-brand { - font-size: 1.7rem; -} - -.navbar-lg .navbar-brand img { - height: 2.3rem; -} - -.navbar-nav { - display: flex; - flex-wrap: wrap; - flex-grow: 1; - align-items: center; - margin: 0px; - padding: 0px; - list-style: none; - line-height: inherit; -} - -.nav-link { - display: block; - margin: 0px; - border: 0px; - padding: 1rem 1rem; -} - -/* Do not display site header on print mediums */ -@media print { - #seedu-header { - display: none; - } - - #site-header { - display: none; - } -} diff --git a/docs/team/johndoe.adoc b/docs/team/johndoe.adoc deleted file mode 100644 index f39e76e49b2..00000000000 --- a/docs/team/johndoe.adoc +++ /dev/null @@ -1,72 +0,0 @@ -= John Doe - Project Portfolio -:site-section: AboutUs -:imagesDir: ../images -:stylesDir: ../stylesheets - -== PROJECT: AddressBook - Level 3 - ---- - -== Overview - -AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC. - -== Summary of contributions - -* *Major enhancement*: added *the ability to undo/redo previous commands* -** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. -** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. -** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. -** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_ - -* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys. - -* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_ - -* *Other contributions*: - -** Project management: -*** Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub -** Enhancements to existing features: -*** Updated the GUI color scheme (Pull requests https://github.com[#33], https://github.com[#34]) -*** Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests https://github.com[#36], https://github.com[#38]) -** Documentation: -*** Did cosmetic tweaks to existing contents of the User Guide: https://github.com[#14] -** Community: -*** PRs reviewed (with non-trivial review comments): https://github.com[#12], https://github.com[#32], https://github.com[#19], https://github.com[#42] -*** Contributed to forum discussions (examples: https://github.com[1], https://github.com[2], https://github.com[3], https://github.com[4]) -*** Reported bugs and suggestions for other teams in the class (examples: https://github.com[1], https://github.com[2], https://github.com[3]) -*** Some parts of the history feature I added was adopted by several other class mates (https://github.com[1], https://github.com[2]) -** Tools: -*** Integrated a third party library (Natty) to the project (https://github.com[#42]) -*** Integrated a new Github plugin (CircleCI) to the team repo - -_{you can add/remove categories in the list above}_ - -== Contributions to the User Guide - - -|=== -|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._ -|=== - -include::../UserGuide.adoc[tag=delete] - -include::../UserGuide.adoc[tag=dataencryption] - -== Contributions to the Developer Guide - -|=== -|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._ -|=== - -include::../DeveloperGuide.adoc[tag=undoredo] - -include::../DeveloperGuide.adoc[tag=dataencryption] - - -== PROJECT: PowerPointLabs - ---- - -_{Optionally, you may include other projects in your portfolio.}_ diff --git a/docs/team/johndoe.md b/docs/team/johndoe.md new file mode 100644 index 00000000000..1f1e9e6f6db --- /dev/null +++ b/docs/team/johndoe.md @@ -0,0 +1,46 @@ +--- +layout: page +title: John Doe's Project Portfolio Page +--- + +## Project: AddressBook Level 3 + +AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC. + +Given below are my contributions to the project. + +* **New Feature**: Added the ability to undo/redo previous commands. + * What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. + * Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. + * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. + * Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}* + +* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys. + +* **Code contributed**: [RepoSense link]() + +* **Project management**: + * Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub + +* **Enhancements to existing features**: + * Updated the GUI color scheme (Pull requests [\#33](), [\#34]()) + * Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]()) + +* **Documentation**: + * User Guide: + * Added documentation for the features `delete` and `find` [\#72]() + * Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]() + * Developer Guide: + * Added implementation details of the `delete` feature. + +* **Community**: + * PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]() + * Contributed to forum discussions (examples: [1](), [2](), [3](), [4]()) + * Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]()) + * Some parts of the history feature I added was adopted by several other class mates ([1](), [2]()) + +* **Tools**: + * Integrated a third party library (Natty) to the project ([\#42]()) + * Integrated a new Github plugin (CircleCI) to the team repo + +* _{you can add/remove categories in the list above}_ diff --git a/docs/templates/LICENSE b/docs/templates/LICENSE deleted file mode 100644 index 2073b44dee6..00000000000 --- a/docs/templates/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -This directory contains code from the Asciidoctor Project. -(https://asciidoctor.org/) - -MIT License - -Copyright (C) 2012-2018 Dan Allen, Ryan Waldron and the Asciidoctor Project - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/docs/templates/_footer.html.slim b/docs/templates/_footer.html.slim deleted file mode 100644 index 938ed7ddc61..00000000000 --- a/docs/templates/_footer.html.slim +++ /dev/null @@ -1,12 +0,0 @@ -/ NOTE: You must restart the gradle daemon after modifying any template file for the changes to take effect. -#footer - .container - #footer-text - - if attr? :revnumber - |#{attr 'version-label'} #{attr :revnumber} - - if attr? :revnumber && (attr? 'last-update-label') - br - - if attr? 'last-update-label' - |#{attr 'last-update-label'} #{attr :docdatetime} - - unless (docinfo_content = (docinfo :footer)).empty? - =docinfo_content diff --git a/docs/templates/_footnotes.html.slim b/docs/templates/_footnotes.html.slim deleted file mode 100644 index 0cacda3e529..00000000000 --- a/docs/templates/_footnotes.html.slim +++ /dev/null @@ -1,7 +0,0 @@ -/ NOTE: You must restart the gradle daemon after modifying any template file for the changes to take effect. -#footnotes - hr - - footnotes.each do |fn| - .footnote id=(footnote_id fn.index) - a href="##{footnoteref_id fn.index}" =fn.index - |. #{fn.text} diff --git a/docs/templates/_header.html.slim b/docs/templates/_header.html.slim deleted file mode 100644 index 3c2d5aed43c..00000000000 --- a/docs/templates/_header.html.slim +++ /dev/null @@ -1,76 +0,0 @@ -/ NOTE: You must restart the gradle daemon after modifying any template file for the changes to take effect. -- if !(attr? 'no-site-header') && (attr? 'site-seedu') - #seedu-header - nav.navbar.navbar-lg.navbar-light.bg-lighter - .container - a.navbar-brand href='https://se-edu.github.io/' - img src=(site_url 'images/SeEduLogo.png') alt='SE-EDU' - ul.navbar-nav - li.nav-item - a.nav-link href='https://se-edu.github.io/addressbook-level1' AB-1 - li.nav-item - a.nav-link href='https://se-edu.github.io/addressbook-level2' AB-2 - li.nav-item - a.nav-link.active href=(site_url 'index.html') AB-3 - li.nav-item - a.nav-link href='https://se-edu.github.io/addressbook-level4' AB-4 - li.nav-item - a.nav-link href='https://se-edu.github.io/collate' Collate - li.nav-item - a.nav-link href='https://se-edu.github.io/se-book' Book - li.nav-item - a.nav-link href='https://se-edu.github.io/learningresources' Resources - -- if !(attr? 'no-site-header') - #site-header - nav.navbar.navbar-light.bg-light - .container - - if attr? 'site-name' - a.navbar-brand href=(site_url 'index.html') =(attr 'site-name') - ul.navbar-nav - li.nav-item - =nav_link('UserGuide', 'UserGuide.html', 'User Guide') - li.nav-item - =nav_link('DeveloperGuide', 'DeveloperGuide.html', 'Developer Guide') - - if attr? 'site-seedu' - li.nav-item - =nav_link('LearningOutcomes', 'LearningOutcomes.html', 'LOs') - li.nav-item - =nav_link('AboutUs', 'AboutUs.html', 'About Us') - li.nav-item - =nav_link('ContactUs', 'ContactUs.html', 'Contact Us') - - if attr? 'site-githuburl' - li.navitem - a.nav-link href=(attr 'site-githuburl') - span.fa.fa-github.fa-lg aria-hidden='true' - |  View on GitHub - -/ AsciiDoc leaves an empty header div even if there's no doctitle -#header - - if has_header? - - unless notitle - h1 =header.title - - if [:author, :revnumber, :revdate, :revremark].any? {|a| attr? a } - .details - - if attr? :author - span.author#author =(attr :author) - br - - if attr? :email - span.email#email =sub_macros(attr :email) - br - - if (authorcount = (attr :authorcount).to_i) > 1 - - (2..authorcount).each do |idx| - span.author id="author#{idx}" =(attr "author_#{idx}") - br - - if attr? "email_#{idx}" - span.email id="email#{idx}" =sub_macros(attr "email_#{idx}") - - if attr? :revnumber - span#revnumber #{((attr 'version-label') || '').downcase} #{attr :revnumber}#{',' if attr? :revdate} - ' - - if attr? :revdate - span#revdate =attr :revdate - - if attr? :revremark - br - span#revremark =(attr :revremark) - - if (attr? :toc) && (attr? 'toc-placement', 'auto') - include _toc.html diff --git a/docs/templates/_toc.html.slim b/docs/templates/_toc.html.slim deleted file mode 100644 index f0ad719fe0f..00000000000 --- a/docs/templates/_toc.html.slim +++ /dev/null @@ -1,5 +0,0 @@ -/ NOTE: You must restart the gradle daemon after modifying any template file for the changes to take effect. -#toc class=(attr 'toc-class', 'toc') - #toctitle =(attr 'toc-title') - / Renders block_outline.html. - = converter.convert document, 'outline' diff --git a/docs/templates/document.html.slim b/docs/templates/document.html.slim deleted file mode 100644 index 3e1961d4afa..00000000000 --- a/docs/templates/document.html.slim +++ /dev/null @@ -1,29 +0,0 @@ -/ NOTE: You must restart the gradle daemon after modifying any template file for the changes to take effect. -doctype 5 -html lang=(attr :lang, 'en' unless attr? :nolang) - head - meta charset=(attr :encoding, 'UTF-8') - /[if IE] - meta http-equiv="X-UA-Compatible" content="IE=edge" - meta name='viewport' content='width=device-width, initial-scale=1.0' - meta name='generator' content="Asciidoctor #{attr 'asciidoctor-version'}" - = html_meta_if 'application-name', (attr 'app-name') - = html_meta_if 'author', (attr :authors) - = html_meta_if 'copyright', (attr :copyright) - = html_meta_if 'description', (attr :description) - = html_meta_if 'keywords', (attr :keywords) - title=((doctitle sanitize: true) || (attr 'untitled-label')) - = styles_and_scripts - - unless (docinfo_content = docinfo).empty? - =docinfo_content - body( - id=id - class=[(attr :doctype), ("#{attr 'toc-class'} toc-#{attr 'toc-position', 'left'}" if (attr? 'toc-class') && (attr? :toc) && (attr? 'toc-placement', 'auto'))] - style=style_value(max_width: (attr 'max-width'))) - - unless noheader - include _header.html - #content =content - - unless !footnotes? || (attr? :nofootnotes) - include _footnotes.html - - unless nofooter - include _footer.html diff --git a/docs/templates/helpers.rb b/docs/templates/helpers.rb deleted file mode 100644 index 7060efe223e..00000000000 --- a/docs/templates/helpers.rb +++ /dev/null @@ -1,300 +0,0 @@ -# NOTE: You must restart the gradle daemon after modifying any template file for the changes to take effect. -require 'asciidoctor' -require 'json' - -if Gem::Version.new(Asciidoctor::VERSION) <= Gem::Version.new('1.5.1') - fail 'asciidoctor: FAILED: HTML5/Slim backend needs Asciidoctor >=1.5.2!' -end - -unless defined? Slim::Include - fail 'asciidoctor: FAILED: HTML5/Slim backend needs Slim >= 2.1.0!' -end - -# Add custom functions to this module that you want to use in your Slim -# templates. Within the template you can invoke them as top-level functions -# just like in Haml. -module Slim::Helpers - - # URIs of external assets. - FONT_AWESOME_URI = '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css' - HIGHLIGHTJS_BASE_URI = '//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4' - MATHJAX_JS_URI = '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML' - PRETTIFY_BASE_URI = '//cdnjs.cloudflare.com/ajax/libs/prettify/r298' - - # Defaults - DEFAULT_HIGHLIGHTJS_THEME = 'github' - DEFAULT_PRETTIFY_THEME = 'prettify' - DEFAULT_SECTNUMLEVELS = 3 - DEFAULT_TOCLEVELS = 2 - - # The MathJax configuration. - MATHJAX_CONFIG = { - tex2jax: { - inlineMath: [::Asciidoctor::INLINE_MATH_DELIMITERS[:latexmath]], - displayMath: [::Asciidoctor::BLOCK_MATH_DELIMITERS[:latexmath]], - ignoreClass: 'nostem|nolatexmath' - }, - asciimath2jax: { - delimiters: [::Asciidoctor::BLOCK_MATH_DELIMITERS[:asciimath]], - ignoreClass: 'nostem|noasciimath' - } - }.to_json - - VOID_ELEMENTS = %w(area base br col command embed hr img input keygen link meta param source track wbr) - - - ## - # Creates an HTML tag with the given name and optionally attributes. Can take - # a block that will run between the opening and closing tags. - # - # @param name [#to_s] the name of the tag. - # @param attributes [Hash] - # @param content [#to_s] the content; +nil+ to call the block. - # @yield The block of Slim/HTML code within the tag (optional). - # @return [String] a rendered HTML element. - # - def html_tag(name, attributes = {}, content = nil) - attrs = attributes.reject { |_, v| - v.nil? || (v.respond_to?(:empty?) && v.empty?) - }.map do |k, v| - v = v.compact.join(' ') if v.is_a? Array - v = nil if v == true - v = %("#{v}") if v - [k, v] * '=' - end - attrs_str = attrs.empty? ? '' : attrs.join(' ').prepend(' ') - - if VOID_ELEMENTS.include? name.to_s - %(<#{name}#{attrs_str}>) - else - content ||= yield if block_given? - %(<#{name}#{attrs_str}>#{content}) - end - end - - ## - # Formats the given hash as CSS declarations for an inline style. - # - # @example - # style_value(text_align: 'right', float: 'left') - # => "text-align: right; float: left;" - # - # style_value(text_align: nil, float: 'left') - # => "float: left;" - # - # style_value(width: [90, '%'], height: '50px') - # => "width: 90%; height: 50px;" - # - # style_value(width: ['120px', 'px']) - # => "width: 90px;" - # - # style_value(width: [nil, 'px']) - # => nil - # - # @param declarations [Hash] - # @return [String, nil] - # - def style_value(declarations) - decls = [] - - declarations.each do |prop, value| - next if value.nil? - - if value.is_a? Array - value, unit = value - next if value.nil? - value = value.to_s + unit unless value.end_with? unit - end - prop = prop.to_s.gsub('_', '-') - decls << %(#{prop}: #{value}) - end - - decls.empty? ? nil : decls.join('; ') + ';' - end - - def urlize(*segments) - path = segments * '/' - if path.start_with? '//' - @_uri_scheme ||= document.attr 'asset-uri-scheme', 'https' - path = %(#{@_uri_scheme}:#{path}) unless @_uri_scheme.empty? - end - normalize_web_path path - end - - - ## - # @param index [Integer] the footnote's index. - # @return [String] footnote id to be used in a link. - def footnote_id(index = (attr :index)) - %(_footnote_#{index}) - end - - ## - # @param index (see #footnote_id) - # @return [String] footnoteref id to be used in a link. - def footnoteref_id(index = (attr :index)) - %(_footnoteref_#{index}) - end - - def icons? - document.attr? :icons - end - - def font_icons? - document.attr? :icons, 'font' - end - - def nowrap? - 'nowrap' if !document.attr?(:prewrap) || option?('nowrap') - end - - #-------------------------------------------------------- - # _header - # - - ## - # Constructs a relative path to the target page. - # - # @param href [String] Path to the target page, relative to the site root. - # @return [String] Path to the target page, relative to the current document. - def site_url(href) - path_resolver = (@path_resolver ||= PathResolver.new) - base_dir = path_resolver.posixify(@document.base_dir) - site_root = path_resolver.posixify(@document.attr('site-root', base_dir)) - unless path_resolver.is_root? site_root - raise ::ArgumentError, %(site-root must be an absolute path: #{site_root}) - end - base_dir_to_root = nil - if (base_dir != site_root) && (base_dir.start_with? site_root) - comp, root = path_resolver.partition_path(base_dir.slice(site_root.length + 1, base_dir.length)) - base_dir_to_root = '../' * comp.length - end - path_resolver.web_path(href, base_dir_to_root) - end - - ## - # Constructs a HTML tag representing a link in the navigation bar. - # - # @param section [String] Name of the site section represented by the link. - # This is used to highlight the navigation item if the current document - # sets its site-section attribute to this String, indicating that the - # reader is browsing this section of the site. - # @param href [String] Path to the target page, relative to the site root. - # @param content [String] Link content. This is usually the human-readable name - # of the link target. - # @return [String] The rendered tag. - def nav_link(section, href, content) - attributes = { - :class => ['nav-link'], - :href => site_url(href), - } - attributes[:class].push('active') if (attr 'site-section') == section - html_tag('a', attributes, content) - end - - #-------------------------------------------------------- - # document - # - - ## - # Returns HTML meta tag if the given +content+ is not +nil+. - # - # @param name [#to_s] the name for the metadata. - # @param content [#to_s, nil] the value of the metadata, or +nil+. - # @return [String, nil] the meta tag, or +nil+ if the +content+ is +nil+. - # - def html_meta_if(name, content) - %() if content - end - - # Returns formatted style/link and script tags for header. - def styles_and_scripts - scripts = [] - styles = [] - tags = [] - - stylesheet = attr :stylesheet - stylesdir = attr :stylesdir, '' - default_style = ::Asciidoctor::DEFAULT_STYLESHEET_KEYS.include? stylesheet - linkcss = (attr? :linkcss) || safe >= ::Asciidoctor::SafeMode::SECURE - ss = ::Asciidoctor::Stylesheets.instance - - if linkcss - path = default_style ? ::Asciidoctor::DEFAULT_STYLESHEET_NAME : stylesheet - styles << { href: [stylesdir, path] } - elsif default_style - styles << { text: ss.primary_stylesheet_data } - else - styles << { text: read_asset(normalize_system_path(stylesheet, stylesdir), true) } - end - - if attr? :icons, 'font' - if attr? 'iconfont-remote' - styles << { href: (attr 'iconfont-cdn', FONT_AWESOME_URI) } - else - styles << { href: [stylesdir, %(#{attr 'iconfont-name', 'font-awesome'}.css)] } - end - end - - if attr? 'stem' - scripts << { src: MATHJAX_JS_URI } - scripts << { type: 'text/x-mathjax-config', text: %(MathJax.Hub.Config(#{MATHJAX_CONFIG});) } - end - - case attr 'source-highlighter' - when 'coderay' - if (attr 'coderay-css', 'class') == 'class' - if linkcss - styles << { href: [stylesdir, ss.coderay_stylesheet_name] } - else - styles << { text: ss.coderay_stylesheet_data } - end - end - - when 'pygments' - if (attr 'pygments-css', 'class') == 'class' - if linkcss - styles << { href: [stylesdir, ss.pygments_stylesheet_name(attr 'pygments-style')] } - else - styles << { text: ss.pygments_stylesheet_data(attr 'pygments-style') } - end - end - - when 'highlightjs' - hjs_base = attr :highlightjsdir, HIGHLIGHTJS_BASE_URI - hjs_theme = attr 'highlightjs-theme', DEFAULT_HIGHLIGHTJS_THEME - - scripts << { src: [hjs_base, 'highlight.min.js'] } - scripts << { src: [hjs_base, 'lang/common.min.js'] } - scripts << { text: 'hljs.initHighlightingOnLoad()' } - styles << { href: [hjs_base, %(styles/#{hjs_theme}.min.css)] } - - when 'prettify' - prettify_base = attr :prettifydir, PRETTIFY_BASE_URI - prettify_theme = attr 'prettify-theme', DEFAULT_PRETTIFY_THEME - - scripts << { src: [prettify_base, 'prettify.min.js'] } - scripts << { text: 'document.addEventListener("DOMContentLoaded", prettyPrint)' } - styles << { href: [prettify_base, %(#{prettify_theme}.min.css)] } - end - - styles.each do |item| - if item.key?(:text) - tags << html_tag(:style, {}, item[:text]) - else - tags << html_tag(:link, rel: 'stylesheet', href: urlize(*item[:href])) - end - end - - scripts.each do |item| - if item.key? :text - tags << html_tag(:script, {type: item[:type]}, item[:text]) - else - tags << html_tag(:script, type: item[:type], src: urlize(*item[:src])) - end - end - - tags.join "\n" - end - -end diff --git a/docs/tutorials/RemovingFields.adoc b/docs/tutorials/RemovingFields.adoc deleted file mode 100644 index 5a50b6965a6..00000000000 --- a/docs/tutorials/RemovingFields.adoc +++ /dev/null @@ -1,117 +0,0 @@ -= Tutorial - Removing a field from an entity -:site-section: DeveloperGuide -:imagesDir: ../images/remove -:stylesDir: ../stylesheets -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:warning-caption: :warning: -endif::[] - -[quote, Antoine de Saint-Exupery] -Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. - -== Introduction -When working on Address Book, you will most likely find that some features and fields that are no longer necessary. -In scenarios like this, you can consider refactoring the existing `Person` model to suit your use case. - -In this tutorial, we'll do exactly just that and remove the `address` field from `Person`. - -== Safely deleting `Address` - -Fortunately, the IntelliJ IDEA provides a robust refactoring tool that can identify _most_ usages. -Let's try to use it as much as we can. - -=== Assisted refactoring -The `address` field in `Person` is actually an instance of the `seedu.address.model.person.Address` class. -Since removing the `Address` class will break the application, we start by identifying ``Address``'s usages. -This allows us to see code that depends on `Address` to function properly and edit them on a case-by-case basis. -Right-click the `Address` class and select `Refactor` > `Safe Delete` through the menu. - -.Usages detected -image::UnsafeDelete.png[width=787px. height=238px] - -Choose to `View Usages` and you should be presented with a list of `Safe Delete Conflicts`. -These conflicts describe locations in which the `Address` class is used. - -.List of conflicts -image::SafeDeleteConflicts.png[width=955, height=640px] - -Remove usages of `Address` by performing ``Safe Delete``s on each entry. -You will need to exercise discretion when removing usages of `Address`. -Functions like `ParserUtil#parseAddress()` can be safely removed but its usages must be removed as well. -Other usages like in `EditPersonDescriptor` may require more careful inspection. - -Let's try removing references to `Address` in `EditPersonDescriptor`. - -. Safe delete the field `address` in `EditPersonDescriptor` -. Select `Yes` when prompted to remove getters and setters -. Select `View Usages` again image:UnsafeDeleteOnField.png[width=1145px, height=583px] -. Remove the usages of `address` and select `Do refactor` when you are done. -+ -TIP: Removing usages may result in errors. -Exercise discretion and fix them. -For example, removing the `address` field from the `Person` class will require you to modify its constructor. - -. Repeat the steps for the remaining usages of `Address` - -After you are done, verify that the application still works by compiling and running it again. - -=== Manual refactoring - -Unfortunately, there are usages of `Address` that IntelliJ IDEA cannot identify. -You can find them by searching for instances of the word `address` in your code (`Edit` > `Find` > `Find in path`). - -Places of interest to look out for would be resources used by the application. -`main/resources` contains images and `fxml` files used by the application and `test/resources` contains test data. -For example, there is a `$address` in each `PersonCard` that has not been removed nor identified. - -image::$address.png[width=1090px, height=890px] - -A quick look at the `PersonCard` class and its `fxml` file quickly reveals why it slipped past the automated refactoring. - -.PersonCard.java -[source, java] ----- -... -@FXML -private Label address; -... ----- - -.PersonCard.fxml -[source, xml] ----- -... -