forked from JacquesCarette/Drasil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
590 changed files
with
15,102 additions
and
4,262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
on: | ||
pull_request: | ||
branches: master | ||
branches: main | ||
paths: 'code/drasil-**' | ||
name: Linter | ||
concurrency: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Wiki | ||
on: | ||
push: | ||
branches: [main] | ||
paths: [wiki/**, .github/workflows/Wiki.yaml] | ||
pull_request: | ||
branches: [main] | ||
paths: [wiki/**, .github/workflows/Wiki.yaml] | ||
permissions: | ||
contents: write | ||
jobs: | ||
check_directories: | ||
name: "Audit changes" | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "No new directories in ./wiki/" | ||
run: | | ||
if git diff --name-only --diff-filter=A origin/main... | grep -q '^wiki/.*/'; then | ||
echo "New directory detected in wiki folder. This is not allowed." | ||
exit 1 | ||
fi | ||
- name: "No manually added disclaimers" | ||
run: | | ||
notice='Warning: Wiki should not be edited directly' | ||
bad_files=$(grep -rl "$notice" wiki || true) | ||
if [ -n "$bad_files" ]; then | ||
echo "Edit disclaimers are automatically prepended. Please remove those manually added. Bad files:" | ||
echo "$bad_files" | ||
exit 1 | ||
fi | ||
- name: "Windows-friendly file names" | ||
run: | | ||
bad_file_names=$(find wiki -type f -name "*[\\/:*?\"<>|]*") | ||
if [ -n "$bad_file_names" ]; then | ||
echo "Windows-friendly file names must not contain any of \"\\/:*?\"<>|\". Bad files:" | ||
echo "$bad_file_names" | ||
exit 1 | ||
fi | ||
wiki: | ||
name: "Publish changes" | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: # Fetch enough history to resolve HEAD^ -- https://github.com/actions/checkout?tab=readme-ov-file#checkout-head | ||
fetch-depth: 2 | ||
|
||
- name: "Configure git client" | ||
run: | | ||
git config --global user.name "${{ secrets.BOT_NAME }}" | ||
git config --global user.email "${{ secrets.BOT_EMAIL }}" | ||
- name: "Prepend wiki edit warnings" | ||
run: | | ||
notice='_Warning: Wiki should not be edited directly. Edit the files in the ./wiki/ folder instead and make a PR._' | ||
for file in wiki/*.md; do | ||
[ "$(basename "$file")" = "_Sidebar.md" ] && continue | ||
sed -i '1s|^|'"$notice"'\n\n|' "$file" | ||
done | ||
- name: "Clone .wiki repository" | ||
run: | | ||
git clone https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/${{ github.repository }}.wiki.git | ||
- name: "Update ~.wiki.git contents" | ||
run: | | ||
rsync -av --delete --exclude '.git' wiki/ ${GITHUB_REPOSITORY##*/}.wiki/ | ||
- name: "Commit and push changes" | ||
run: | | ||
cd ${GITHUB_REPOSITORY##*/}.wiki | ||
git add . | ||
if [ -n "$(git status --porcelain)" ]; then | ||
git commit -m "Update wiki content at ${{ github.sha }}" | ||
git push origin master | ||
else | ||
echo "No changes to commit" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
## Purpose: generates a template with unimplemented instances of all the classes | ||
# in the target file. | ||
# Instructions: Modify the strings under # Inputs: inFilePath, outFilePath, oldName, newName. | ||
# inFilePath should be a path to an existing renderer (e.g. SwiftRenderer.hs) | ||
# oldName should be the name of the main type for the existing renderer (e.g. SwiftRenderer) | ||
# newFilePath and newName should be pretty self-explanatory. | ||
# Then run the file with your python3 interpreter. | ||
# Created by Brandon Bosman | ||
# Date: May 16, 2024 | ||
|
||
# Inputs | ||
inFilePath = "drasil-gool/lib/GOOL/Drasil/LanguageRenderer/SwiftRenderer.hs" | ||
outFilePath = "drasil-gool/lib/GOOL/Drasil/LanguageRenderer/TemplateJuliaRenderer.hs" | ||
oldName = "SwiftCode" | ||
newName = "JuliaCode" | ||
|
||
# The datatype for an instance: it has a declaration, some types, and some methods | ||
def newInstance(line: str): | ||
return { | ||
"declaration" : line.replace(oldName, newName), | ||
"types" : [], | ||
"methods" : [] | ||
} | ||
|
||
# Read file | ||
with open(inFilePath, "r") as inFile: | ||
lines = inFile.readlines() | ||
|
||
# Go through lines and find instances of typeclasses | ||
instances = [] | ||
inInstance = False | ||
|
||
for line in lines: | ||
|
||
# Detect an instance declaration | ||
if line.startswith("instance"): | ||
inInstance = True | ||
instances.append(newInstance(line)) | ||
continue | ||
|
||
if inInstance: | ||
|
||
# Unindented code means the current instance is finished | ||
if not line.isspace() and not line.startswith(" "): | ||
inInstance = False | ||
print("Not instance: " + line) | ||
continue | ||
|
||
# Skim over blank lines and lines indented more than once | ||
if line.isspace(): | ||
print("All space: " + line) | ||
continue | ||
|
||
if len(line) > 2 and line[2] == " ": | ||
print("Nested indent: " + line) | ||
continue | ||
|
||
start = 2 # the first character after the indent | ||
|
||
# Add types and methods | ||
if line[start:].startswith("type"): | ||
instances[-1]["types"].append(line.replace(oldName, newName)) | ||
else: | ||
# Add everything before the 'main' = sign ('main' determined by | ||
# brackets), then add undefined after the = sign. | ||
end = start + 1 | ||
brackets = 0 | ||
while end <= len(line) and (line[end-1] != "=" or brackets != 0): | ||
if line[end-1] == "(": | ||
brackets += 1 | ||
elif line[end-1] == ")": | ||
brackets -= 1 | ||
end += 1 | ||
instances[-1]["methods"].append(line[0:end] + " undefined") | ||
|
||
# Output findings | ||
with open(outFilePath, "w") as outFile: | ||
outFile.write("") | ||
|
||
with open(outFilePath, "a") as outFile: | ||
for instance in instances: | ||
outFile.write(instance["declaration"]) | ||
for type in instance["types"]: | ||
outFile.write(type + "\n") | ||
for method in instance["methods"]: | ||
outFile.write(method + "\n") | ||
outFile.write("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Software Requirements Specification (SRS) Demo using mdBook | ||
|
||
This project represents a manually crafted Software Requirements Specification (SRS), utilizing mdBook, for the [Projectile](https://jacquescarette.github.io/Drasil/examples/projectile/SRS/srs/Projectile_SRS.html) | ||
case study within the [Drasil](https://github.com/JacquesCarette/Drasil) framework. It is intended to serve as a foundational reference for future Drasil development, guiding the generation of a new SRS artifact format. | ||
|
||
## Installation | ||
|
||
Please follow the installation instructions in the [mdBook Documentation](https://rust-lang.github.io/mdBook/guide/installation.html). | ||
|
||
## Demo | ||
|
||
1. **Clone the Repository**: Clone this repository to your local machine. | ||
2. **Launch the Server**: Open a command line interface in the cloned repository's directory and run `mdbook serve --open`. | ||
3. **Acces the Local Server**: The terminal will display the `localhost` server address. | ||
|
||
## mdBook Quirks | ||
|
||
- Have to wrap certain elements in `<div id=""></div>` to be able to be referenced. | ||
- Cannot add captions to tables and images. Have to use `<p align="center">CAPTION</p>`. | ||
- Mathjax LaTeX equations do not wrap similar to LaTeX (`$EQUATION$`) or HTML (`\(EQUATION\)`). mdBook syntax is `\\(EQUATION\\)` for inline and `\\[EQUATION\\]` for block equations. | ||
- Some elements of equations require an extra `\`. Ex. new line is `\\\`. | ||
- `\symbf` does not work in Mathjax LaTeX equations, have to use `\boldsymbol` instead. | ||
- Typical list syntax does not work inside tables in Markdown. Have to wrap in `<ul> <li>item1</li> <li>item2</li> </ul>`. | ||
- Accessible assets (Ex. images) need to be inside the `src` folder in order to be rendered. NOTE: There may be a way to use assets outside `src` through the `book.toml` | ||
- Sometimes there is very little space or no space at all between components. Added `</br>` to add extra space. | ||
- Need to add mathjax support in the `book.toml`. Not added by default. | ||
|
||
## Other Notes | ||
|
||
- Having a page for Table of Contents may be redundant as mdBook automatically creates one for you. | ||
- The HTML SRS for variables or short equations often uses HTML syntax, rather than LaTeX. For example, `<em></em>` for italicizing single variables. This creates slight differences in appearance within the SRS. The mdBook demo uses LaTeX for everything. | ||
- Each section and subsection has its own page. As a result, some pages have very little content. | ||
- Can format code for tables in two ways. Both formats look the same when rendered. | ||
- Visually readable code but longer | ||
https://github.com/BilalM04/projectileSRS-mdbook/blob/9cc1553a9c9f95de1735dcc81c5f3285f6c073f2/src/table-of-units.md?plain=1#L6-L12 | ||
- Less readable code but shorter | ||
https://github.com/BilalM04/projectileSRS-mdbook/blob/9cc1553a9c9f95de1735dcc81c5f3285f6c073f2/src/auxiliary-constants.md?plain=1#L4-L10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[book] | ||
authors = ["BilalM04"] | ||
language = "en" | ||
multilingual = false | ||
src = "src" | ||
title = "Software Requirements Specification for Projectile" | ||
[output.html] | ||
mathjax-support = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Summary | ||
|
||
- [Software Requirements Specification for Projectile](./title.md) | ||
- [Table of Contents](./contents.md) | ||
- [Reference Material](./reference-material.md) | ||
- [Table of Units](./table-of-units.md) | ||
- [Table of Symbols](./table-of-symbols.md) | ||
- [Abbreviations and Acronyms](./abbrv-and-acronyms.md) | ||
- [Introduction](./introduction.md) | ||
- [Purpose of Document](./purpose-of-doc.md) | ||
- [Scope of Requirements](./scope-of-req.md) | ||
- [Characteristics of Intended Reader](./characteristics-of-reader.md) | ||
- [Organization of Document](./organization-of-doc.md) | ||
- [General System Description](./general-sys-description.md) | ||
- [System Context](./sys-context.md) | ||
- [User Characteristics](./user-characteristics.md) | ||
- [System Constraints](./sys-constrainsts.md) | ||
- [Specific System Description](./specific-sys-description.md) | ||
- [Problem Description](./problem-description.md) | ||
- [Terminology and Definitions](./terms-and-definitions.md) | ||
- [Physical System Description](./physical-sys-description.md) | ||
- [Goal Statements](./goal-statements.md) | ||
- [Solution Characteristics Specification](./sol-characteristics-spec.md) | ||
- [Assumptions](./assumptions.md) | ||
- [Theoretical Models](./theoretical-models.md) | ||
- [General Definitions](./general-definitions.md) | ||
- [Data Definitions](./data-definitions.md) | ||
- [Instance Models](./instance-models.md) | ||
- [Data Constraints](./data-constraints.md) | ||
- [Properties of a Correct Solution](./properties-of-solution.md) | ||
- [Requirements](./requirements.md) | ||
- [Functional Requirements](./functional-req.md) | ||
- [Non-Functional Requirements](./non-functional-req.md) | ||
- [Traceability Matrices and Graphs](./matrices-and-graphs.md) | ||
- [Values of Auxiliary Constants](./auxiliary-constants.md) | ||
- [References](./references.md) |
Oops, something went wrong.