Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snipper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tuhe
snipper
Commits
00e4f6b1
Commit
00e4f6b1
authored
3 years ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
Updates
parent
7655b644
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+6
-6
6 additions, 6 deletions
README.md
docs/README.jinja.md
+6
-6
6 additions, 6 deletions
docs/README.jinja.md
docs/latex_nup.pdf
+0
-0
0 additions, 0 deletions
docs/latex_nup.pdf
with
12 additions
and
12 deletions
README.md
+
6
−
6
View file @
00e4f6b1
...
@@ -30,9 +30,9 @@ examples/cs101_students # This directory contains the (processed) student fil
...
@@ -30,9 +30,9 @@ examples/cs101_students # This directory contains the (processed) student fil
examples/cs101_output # This contains automatically generated contents (snippets, etc.).
examples/cs101_output # This contains automatically generated contents (snippets, etc.).
```
```
The basic functionality is you insert special comment tags in your source, such as
`#!b`
or
`#!s`
and the script then process
The basic functionality is you insert special comment tags in your source, such as
`#!b`
or
`#!s`
and the script then process
the sources based on the tags. The following will show most
basic
usages:
the sources based on the tags. The following will show most
common
usages:
## The #
f
!-tag
## The #!
f
-tag
Let's start with the simplest example, blocking out a function (see
`examples/cs101_instructor/f_tag.py`
; actually it will work for any scope)
Let's start with the simplest example, blocking out a function (see
`examples/cs101_instructor/f_tag.py`
; actually it will work for any scope)
You insert a comment like:
`#!f <exception message>`
like so:
You insert a comment like:
`#!f <exception message>`
like so:
```
python
```
python
...
@@ -56,7 +56,7 @@ def myfun(a,b):
...
@@ -56,7 +56,7 @@ def myfun(a,b):
return
sm
return
sm
```
```
## The #
b
!-tag
## The #!
b
-tag
The #!b-tag allows you more control over what is cut out. The instructor file:
The #!b-tag allows you more control over what is cut out. The instructor file:
```
python
```
python
def
primes_sieve
(
limit
):
def
primes_sieve
(
limit
):
...
@@ -89,7 +89,7 @@ This allows you to cut out text across scopes, but still allows you to insert ex
...
@@ -89,7 +89,7 @@ This allows you to cut out text across scopes, but still allows you to insert ex
## The #
s
!-tag
## The #!
s
-tag
The #!s-tag is useful for making examples to include in exercises and lecture notes. The #!s (snip) tag cuts out the text between
The #!s-tag is useful for making examples to include in exercises and lecture notes. The #!s (snip) tag cuts out the text between
tags and places it in files found in the output-directory. As an example, here is the instructor file:
tags and places it in files found in the output-directory. As an example, here is the instructor file:
```
python
```
python
...
@@ -146,7 +146,7 @@ and finally:
...
@@ -146,7 +146,7 @@ and finally:
I recommend using
`\inputminted{filename}`
to insert the cutouts in LaTeX.
I recommend using
`\inputminted{filename}`
to insert the cutouts in LaTeX.
## The #
o
!-tag
## The #!
o
-tag
The #!o-tag allows you to capture output from the code, which can be useful when showing students the expected
The #!o-tag allows you to capture output from the code, which can be useful when showing students the expected
behavior of their scripts. Like the #!s-tag, the #!o-tags can be named.
behavior of their scripts. Like the #!s-tag, the #!o-tags can be named.
...
@@ -178,7 +178,7 @@ Area of square of width 2 and height 4 is:
...
@@ -178,7 +178,7 @@ Area of square of width 2 and height 4 is:
and that is a fact!
and that is a fact!
```
```
## The #
i
!-tag
## The #!
i
-tag
The #!i-tag allows you to create interactive python shell-snippets that can be imported using
The #!i-tag allows you to create interactive python shell-snippets that can be imported using
the minted
`pycon`
environment (
`\inputminted{python}{input.shell}`
).
the minted
`pycon`
environment (
`\inputminted{python}{input.shell}`
).
As an example, consider the instructor file
As an example, consider the instructor file
...
...
This diff is collapsed.
Click to expand it.
docs/README.jinja.md
+
6
−
6
View file @
00e4f6b1
...
@@ -30,9 +30,9 @@ examples/cs101_students # This directory contains the (processed) student fil
...
@@ -30,9 +30,9 @@ examples/cs101_students # This directory contains the (processed) student fil
examples/cs101_output # This contains automatically generated contents (snippets, etc.).
examples/cs101_output # This contains automatically generated contents (snippets, etc.).
```
```
The basic functionality is you insert special comment tags in your source, such as
`#!b`
or
`#!s`
and the script then process
The basic functionality is you insert special comment tags in your source, such as
`#!b`
or
`#!s`
and the script then process
the sources based on the tags. The following will show most
basic
usages:
the sources based on the tags. The following will show most
common
usages:
## The #
f
!-tag
## The #!
f
-tag
Let's start with the simplest example, blocking out a function (see
`examples/cs101_instructor/f_tag.py`
; actually it will work for any scope)
Let's start with the simplest example, blocking out a function (see
`examples/cs101_instructor/f_tag.py`
; actually it will work for any scope)
You insert a comment like:
`#!f <exception message>`
like so:
You insert a comment like:
`#!f <exception message>`
like so:
```
python
```
python
...
@@ -47,7 +47,7 @@ The output can be found in `examples/students/f_tag.py`. It will cut out the bod
...
@@ -47,7 +47,7 @@ The output can be found in `examples/students/f_tag.py`. It will cut out the bod
{{
cs101_students
.
f_tag_py
}}
{{
cs101_students
.
f_tag_py
}}
```
```
## The #
b
!-tag
## The #!
b
-tag
The #!b-tag allows you more control over what is cut out. The instructor file:
The #!b-tag allows you more control over what is cut out. The instructor file:
```
python
```
python
{{
cs101_instructor
.
b_tag_py
}}
{{
cs101_instructor
.
b_tag_py
}}
...
@@ -60,7 +60,7 @@ This allows you to cut out text across scopes, but still allows you to insert ex
...
@@ -60,7 +60,7 @@ This allows you to cut out text across scopes, but still allows you to insert ex
## The #
s
!-tag
## The #!
s
-tag
The #!s-tag is useful for making examples to include in exercises and lecture notes. The #!s (snip) tag cuts out the text between
The #!s-tag is useful for making examples to include in exercises and lecture notes. The #!s (snip) tag cuts out the text between
tags and places it in files found in the output-directory. As an example, here is the instructor file:
tags and places it in files found in the output-directory. As an example, here is the instructor file:
```
python
```
python
...
@@ -87,7 +87,7 @@ and finally:
...
@@ -87,7 +87,7 @@ and finally:
I recommend using
`\inputminted{filename}`
to insert the cutouts in LaTeX.
I recommend using
`\inputminted{filename}`
to insert the cutouts in LaTeX.
## The #
o
!-tag
## The #!
o
-tag
The #!o-tag allows you to capture output from the code, which can be useful when showing students the expected
The #!o-tag allows you to capture output from the code, which can be useful when showing students the expected
behavior of their scripts. Like the #!s-tag, the #!o-tags can be named.
behavior of their scripts. Like the #!s-tag, the #!o-tags can be named.
...
@@ -104,7 +104,7 @@ and
...
@@ -104,7 +104,7 @@ and
{{ cs101_output.o_tag_b_txt }}
{{ cs101_output.o_tag_b_txt }}
```
```
## The #
i
!-tag
## The #!
i
-tag
The #!i-tag allows you to create interactive python shell-snippets that can be imported using
The #!i-tag allows you to create interactive python shell-snippets that can be imported using
the minted
`pycon`
environment (
`\inputminted{python}{input.shell}`
).
the minted
`pycon`
environment (
`\inputminted{python}{input.shell}`
).
As an example, consider the instructor file
As an example, consider the instructor file
...
...
This diff is collapsed.
Click to expand it.
docs/latex_nup.pdf
+
0
−
0
View file @
00e4f6b1
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment