-
Notifications
You must be signed in to change notification settings - Fork 6
Store source code in repo #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
9f21307
Add make targets to entangle and to clean entangled files
sverhoeven 6c228d3
Use git hook to always entangle before commit
sverhoeven 8c01662
Add placeholder for .githooks dir
sverhoeven 6dee4f4
Add git hook script
sverhoeven d2670ed
Added entangle output files
sverhoeven 1a843bd
Added Perl as dep
sverhoeven 9fb745b
Only git add when files are written
sverhoeven feeef08
In GH action dont entangle but check entangle is up to date
sverhoeven fbe821f
Merge remote-tracking branch 'origin/master' into entangled-files-1
sverhoeven 2217bb0
Dont use `-ti` in Docker command as it is not needed
sverhoeven 527d398
Updated Makefile
sverhoeven 4a46874
Added CONTRIBUTING.md + Move testing to TESTING.md + Moved code gener…
sverhoeven 5c2f7b5
Added .zenodo.json
sverhoeven 4376eb5
Add anchor comment to new code blocks
sverhoeven 0588001
Ignore compiled files
sverhoeven ac14ae7
Entangling is in CONTRIBITING.md and files are in repo
sverhoeven a09c05a
Split & comment entangle check command
sverhoeven f6bea28
In CI pin Python to 3.8
sverhoeven d6c760d
Capture service logs and upload as artifacts
sverhoeven 9fab092
Fix log filenames + always upload logs
sverhoeven 413dc21
Apply suggestions from code review
sverhoeven d65244a
tee background jobs
sverhoeven 5ba4270
Test against Python 3.6, 3.7 and 3.8
sverhoeven 0453ecc
Use f-string instead of jinja templates
sverhoeven b09b0b6
Describe f-string
sverhoeven 05a7f70
Pin Celery to v4.4.3
sverhoeven 4a2336b
Add Entangled badge
jhidding 88e1c9f
Create entangled.dhall
jhidding e9659f8
Make entangled aware of all Markdown files
sverhoeven 0033d87
Use entangled v1 subcommand to run daemon
sverhoeven 8aab1bf
Ignore entangled db
sverhoeven b29546b
Describe Flask request
sverhoeven 0fcbfed
Update Flask links
sverhoeven File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or 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,16 @@ | ||
| #!/bin/sh | ||
| # this shell script is stored as .githooks/pre-commit | ||
|
|
||
| UID=$(id -u) | ||
|
|
||
| echo 'Check entangled files are up to date' | ||
|
|
||
| # Entangle Markdown to source code and store the output | ||
| LOG=$(docker run --rm --user ${UID} -v ${PWD}:/data nlesc/pandoc-tangle:0.5.0 --preserve-tabs *.md 2>&1 > /dev/null) | ||
| # Parse which filenames have been written from output | ||
| FILES=$(echo $LOG | perl -ne 'print $1,"\n" if /^Writing \`(.*)\`./') | ||
| [ -z "$FILES" ] && exit 0 | ||
| echo $FILES | ||
|
|
||
| echo 'Adding written files to commit' | ||
| echo $FILES | xargs git add |
This file contains hidden or 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 hidden or 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 hidden or 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,6 @@ | ||
| { | ||
| "license": { | ||
| "id": "Apache-2.0" | ||
| }, | ||
| "title": "Guide to make C++ available as a web application" | ||
sverhoeven marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or 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,180 @@ | ||
| # Contributing | ||
|
|
||
| - [Contributing](#contributing) | ||
| - [Types of Contributions](#types-of-contributions) | ||
| - [Report Bugs](#report-bugs) | ||
| - [Fix Bugs](#fix-bugs) | ||
| - [Implement Features](#implement-features) | ||
| - [Submit Feedback](#submit-feedback) | ||
| - [Get Started!](#get-started) | ||
| - [Pull Request Guidelines](#pull-request-guidelines) | ||
| - [Tips](#tips) | ||
| - [Generating code from Markdown](#generating-code-from-markdown) | ||
| - [Generate code from Markdown and vice versa](generate-code-from-markdown-and-vice-versa) | ||
| - [Generate code from Markdown on commit](#generate-code-from-markdown-on-commit) | ||
| - [New release](#new-release) | ||
|
|
||
| Contributions are welcome, and they are greatly appreciated! Every little bit | ||
sverhoeven marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| helps, and credit will always be given. | ||
|
|
||
| You can contribute in many ways: | ||
|
|
||
| ## Types of Contributions | ||
|
|
||
| ### Report Bugs | ||
|
|
||
| Report bugs at [https://github.com/NLESC-JCER/cpp2wasm/issues](https://github.com/NLESC-JCER/cpp2wasm/issues). | ||
|
|
||
| If you are reporting a bug, please include: | ||
|
|
||
| - Your operating system name and version. | ||
| - Any details about your local setup that might be helpful in troubleshooting. | ||
| - Detailed steps to reproduce the bug. | ||
|
|
||
| ### Fix Bugs | ||
|
|
||
| Look through the GitHub issues for bugs. Anything tagged with "bug" and "help | ||
| wanted" is open to whoever wants to implement it. | ||
|
|
||
| ### Implement Features | ||
|
|
||
| Look through the GitHub issues for features. Anything tagged with "enhancement" | ||
| and "help wanted" is open to whoever wants to implement it. | ||
|
|
||
| ### Submit Feedback | ||
|
|
||
| The best way to send feedback is to file an issue at [https://github.com/NLESC-JCER/cpp2wasm/issues](https://github.com/NLESC-JCER/cpp2wasm/issues). | ||
|
|
||
| If you are proposing a feature: | ||
|
|
||
| - Explain in detail how it would work. | ||
| - Keep the scope as narrow as possible, to make it easier to implement. | ||
| - Remember that this is a volunteer-driven project, and that contributions | ||
| are welcome :) | ||
|
|
||
| ## Get Started! | ||
|
|
||
| Ready to contribute? Here's how to set up `cpp2wasm` for local development. | ||
|
|
||
| 1. Fork the `cpp2wasm` repo on GitHub. | ||
| 2. Clone your fork locally:: | ||
|
|
||
| ```shell | ||
| git clone git@github.com:your_name_here/cpp2wasm.git | ||
| ``` | ||
|
|
||
| 3. Install the dependencies as listed in [INSTALL.md#dependencies](INSTALL.md#dependencies). | ||
|
|
||
| 4. Create a branch for local development:: | ||
|
|
||
| ```shell | ||
| git checkout -b name-of-your-bugfix-or-feature | ||
| ``` | ||
|
|
||
| Now you can make your changes locally. | ||
|
|
||
| 5. Write tests where possible. Writing tests should be done in a literate way in [TESTING.md](TESTING.md) | ||
|
|
||
| 6. When you're done making changes, make sure the Markdown and source code files are entangled with. | ||
|
|
||
| ```shell | ||
| make entangle | ||
| ``` | ||
|
|
||
| 7. Commit your changes and push your branch to GitHub:: | ||
|
|
||
| ```shell | ||
| git add . | ||
| git commit -m "Your detailed description of your changes." | ||
| git push origin name-of-your-bugfix-or-feature | ||
| ``` | ||
|
|
||
| 8. Submit a pull request through the GitHub website. | ||
|
|
||
| ## Pull Request Guidelines | ||
|
|
||
| Before you submit a pull request, check that it meets these guidelines: | ||
|
|
||
| 1. The pull request should include tests. | ||
| 2. If the pull request adds functionality, the docs should be updated. Put | ||
| your new functionality into a function with a docstring, and add the | ||
| feature to the list in README.rst. | ||
| 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check | ||
| https://travis-ci.com/{{ cookiecutter.github_username }}/cpp2wasm/pull_requests | ||
| and make sure that the tests pass for all supported Python versions. | ||
|
|
||
| ## Tips | ||
|
|
||
| ## Generating code from Markdown | ||
|
|
||
| The [Entangled - Pandoc filters](https://github.com/entangled/filters) Docker image can be used to generate source code files from the Markdown files. | ||
|
|
||
| ```{.awk #pandoc-tangle} | ||
| docker run --rm --user ${UID} -v ${PWD}:/data nlesc/pandoc-tangle:0.5.0 --preserve-tabs *.md | ||
| ``` | ||
|
|
||
| ## Generate code from Markdown and vice versa | ||
|
|
||
| Use Entangled deamon to convert code blocks in Markdown to and from source code files. | ||
| Each time a Markdown code block is changed the source code files will be updated. | ||
| Each time a source code file is changed the code blocks in the Markdown files will be updated. | ||
|
|
||
| 1. Install [entangled](https://github.com/entangled/entangled) | ||
| 2. Run entangled daemon with | ||
|
|
||
| ```shell | ||
| entangled daemon | ||
| ``` | ||
|
|
||
| ### Generate code from Markdown on commit | ||
|
|
||
| To automatically generate code from Markdown on each commit, initialize the git hook with. | ||
|
|
||
| ```shell | ||
| make init-git-hook | ||
| ``` | ||
|
|
||
| The rest of this section describes how the git hook works. | ||
|
|
||
| The pre-commit hook script runs entangle using Docker and adds newly written files to the current git commit. | ||
|
|
||
| ```{.awk file=.githooks/pre-commit} | ||
| #!/bin/sh | ||
| # this shell script is stored as .githooks/pre-commit | ||
|
|
||
| UID=$(id -u) | ||
|
|
||
| echo 'Check entangled files are up to date' | ||
|
|
||
| # Entangle Markdown to source code and store the output | ||
| LOG=$(docker run --rm --user ${UID} -v ${PWD}:/data nlesc/pandoc-tangle:0.5.0 --preserve-tabs *.md 2>&1 > /dev/null) | ||
| # Parse which filenames have been written from output | ||
| FILES=$(echo $LOG | perl -ne 'print $1,"\n" if /^Writing \`(.*)\`./') | ||
| [ -z "$FILES" ] && exit 0 | ||
| echo $FILES | ||
|
|
||
| echo 'Adding written files to commit' | ||
| echo $FILES | xargs git add | ||
| ``` | ||
|
|
||
| The hook must be made executable with | ||
|
|
||
| ```{.awk #hook-permission} | ||
| chmod +x .githooks/pre-commit | ||
| ``` | ||
|
|
||
| The git hook can be enabled with | ||
|
|
||
| ```{.awk #init-git-hook} | ||
| git config --local core.hooksPath .githooks | ||
| ``` | ||
|
|
||
| (`core.hooksPath` config is available in git version >= 2.9) | ||
|
|
||
| ## New release | ||
|
|
||
| A reminder for the maintainers on how to create a new release. | ||
|
|
||
| 1. Make sure all your changes are committed. | ||
| 1. Create a GitHub release | ||
| 1. Check and fix author list on Zenodo | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.