Skip to content

Commit

Permalink
Merge branch 'JacquesCarette-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
samm82 committed Jun 28, 2024
2 parents e28b931 + af81e96 commit 98cedb2
Show file tree
Hide file tree
Showing 590 changed files with 15,102 additions and 4,262 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
on:
push:
paths: [code/**]
pull_request:
branches: master
branches: main
paths: [code/**]
workflow_dispatch:
name: Build
defaults:
run:
shell: bash
working-directory: code
env:
is_deployment: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
is_deployment: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
jobs:
auto-cancel:
if: |
github.event_name == 'pull_request'
|| github.event_name == 'workflow_dispatch'
|| (github.event_name == 'push' && (github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '[workflow-trigger]')))
|| (github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.event.head_commit.message, '[workflow-trigger]')))
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -45,7 +47,7 @@ jobs:
run: sudo apt-get install -y --fix-missing libgmp-dev python3 graphviz doxygen fonts-lmodern texlive-bibtex-extra texlive-latex-extra texlive-science texlive-xetex texlive-luatex g++ default-jdk mono-devel inkscape

- name: "Install Stack"
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true
Expand Down Expand Up @@ -122,11 +124,11 @@ jobs:

- name: "Deploy 🚀"
if: ${{ fromJSON(env.is_deployment) }}
uses: JamesIves/github-pages-deploy-action@v4.5.0
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
git-config-name: ${{ secrets.BOT_NAME }}
git-config-email: ${{ secrets.BOT_EMAIL }}
token: ${{ secrets.BOT_TOKEN }}
branch: gh-pages
folder: code/deploy
commit-message: "${{ secrets.BOT_NAME }} deploy of master@${{ github.sha }}"
commit-message: "${{ secrets.BOT_NAME }} deploy of main@${{ github.sha }}"
2 changes: 1 addition & 1 deletion .github/workflows/Lint.yaml
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:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/Wiki.yaml
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ desktop.ini
# Editors
.idea
.vscode
.direnv

# Drasil/Haskell
*.cabal
Expand All @@ -24,6 +25,7 @@ dist
stack.yaml.lock
.hlint*
.envrc
.hie

# Drasil supported programming languages
__pycache__
Expand Down
87 changes: 87 additions & 0 deletions People/Brandon-Bosman/genRendererTemplate.py
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")
4 changes: 2 additions & 2 deletions People/Jason/thesis/chapters/03_drasil.tex
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ \section{What is it? What can it do?}
the knowledge capture is the reusability of it to regenerate artifacts in
different, but similarly applicable, languages. For example, the \acs{glassbr}
case study had \porthref{software
artifacts}{https://github.com/smiths/caseStudies/tree/master/CaseStudies/glass}
artifacts}{https://github.com/smiths/caseStudies/tree/main/CaseStudies/glass}
manually built. Once the knowledge was codified in Drasil, the same knowledge
allows re-creation in \porthref{other
languages}{https://github.com/JacquesCarette/Drasil/tree/master/code/stable/glassbr}.
languages}{https://github.com/JacquesCarette/Drasil/tree/main/code/stable/glassbr}.

\roughNetworkOfDomains{}

Expand Down
2 changes: 1 addition & 1 deletion People/Jason/thesis/front/reading_notes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ \chapter{Reading Notes}
and a guide for \porthref{building your own project with
Drasil}{https://github.com/JacquesCarette/Drasil/wiki/Creating-Your-Project-in-Drasil}.
Similarly, the \porthref{source
code}{https://github.com/JacquesCarette/Drasil/tree/master/People/Jason/thesis}
code}{https://github.com/JacquesCarette/Drasil/tree/main/People/Jason/thesis}
for this thesis is also publicly available.

\item ``Source Code'' snippets with ``Original'' in their title show code
Expand Down
2 changes: 1 addition & 1 deletion People/Jason/thesis/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ @unpublished{well-understood
note = {Submitted Nov 2021 to NIER - New Ideas and Emerging Results (ICSE 2022)},
title = {When Capturing Knowledge Improves Productivity},
year = {2021},
url = {https://github.com/JacquesCarette/Drasil/blob/master/Papers/WellUnderstood/wu.pdf}
url = {https://github.com/JacquesCarette/Drasil/blob/main/Papers/WellUnderstood/wu.pdf}
}

@misc{wiki:Vasa_ship,
Expand Down
1 change: 1 addition & 0 deletions People/Mohd-Bilal/projectileSRS-mdBook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
37 changes: 37 additions & 0 deletions People/Mohd-Bilal/projectileSRS-mdBook/README.md
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
8 changes: 8 additions & 0 deletions People/Mohd-Bilal/projectileSRS-mdBook/book.toml
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
36 changes: 36 additions & 0 deletions People/Mohd-Bilal/projectileSRS-mdBook/src/SUMMARY.md
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)
Loading

0 comments on commit 98cedb2

Please sign in to comment.