Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding examples #276

Merged
merged 2 commits into from Nov 20, 2020
Merged

Adding examples #276

merged 2 commits into from Nov 20, 2020

Conversation

jjhursey
Copy link
Member

@jjhursey jjhursey commented Sep 4, 2020

  • Uses the LaTeX minted package to include formatted source code segments.

@jjhursey jjhursey added the WorkInProgress Work In Progress label Sep 4, 2020
@jjhursey
Copy link
Member Author

jjhursey commented Sep 4, 2020

Attached is a rendering of the Examples chapter from this PR:

There is still some cleanup to do, and I need to add some source code compile/link checking. So still a work in progress.

@jjhursey
Copy link
Member Author

jjhursey commented Sep 4, 2020

To do list:

  • Investigate how we can protect the user from changing lines in the source file and it's impact on the examples in the document. Updating the line numbers.
  • Add a Python example

Second Effort to do list:

  • If pcc is available then try to compile and/or link the examples.
  • Add pcc to the CI docker container so we are compiling the examples as they are introduced to make sure they are correct.
  • (Aspire) Highlight the PMIx keywords in the code examples. Requires an extension to the lexer similar to this
  • Investigate if we should use this for other C code blocks in the document.

@jjhursey
Copy link
Member Author

I've pushed an update to this PR that includes a preprocessor script for the examples (see latest commit). The goal here is to add comments to an example, then the preprocessor will split out the code snippets so we can include them in the latex. See sources/hello-alt.c for an example.

The bin/process-example.py script has some notes at the top on what it looks for when preprocessing the source files.

The direct minted way still works fine, but this preprocessor script should give some more flexibility.

@jjhursey jjhursey marked this pull request as ready for review November 6, 2020 12:44
@jjhursey
Copy link
Member Author

jjhursey commented Nov 6, 2020

Ok this is ready for review now. See the sources/README.md for notes on how to use it, and pmix-standard-example.pdf for an example of the rendering.

I should probably include a PMIx Python example - I can see if I can find one.

@jjhursey jjhursey added Editorial and removed WorkInProgress Work In Progress labels Nov 6, 2020
@jjhursey
Copy link
Member Author

jjhursey commented Nov 6, 2020

I just pushed a commit that adds a proper PMIx python example. Should be good now for review.

@jjhursey
Copy link
Member Author

For discussion today:

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
 * Uses the `minted` package to include formatted source code segments
 * Uses a preprocessor script to extract snippets from code examples

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
@jjhursey
Copy link
Member Author

Per discussion on the Nov. 12, 2020 ASC meeting, we decided to merge this in so the working groups can use it in their work.
I rebased the branch and squashed the commits. Once CI passes then this should be ready to go.

@SteVwonder Can you give this a 👍 review so I can merge?

Copy link
Contributor

@SteVwonder SteVwonder left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @jjhursey! The docker build also worked flawlessly!

@jjhursey jjhursey merged commit bbb0712 into pmix:master Nov 20, 2020
@jjhursey jjhursey deleted the ex-source branch November 20, 2020 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants