Browse Source

Inlined parent files in docs

master
Patrick Gaskin 11 months ago
parent
commit
232bdc3572
Signed by: geek1011 GPG Key ID: A2FD79F68A2AB707
8 changed files with 48 additions and 135 deletions
  1. +1
    -1
      docs/config.yaml
  2. +6
    -6
      docs/content/_index.md
  3. +18
    -0
      docs/content/docs/files.md
  4. +16
    -1
      docs/content/docs/guide/install.md
  5. +2
    -119
      docs/content/docs/reference/libraries.md
  6. +3
    -8
      docs/content/menu/index.md
  7. +1
    -0
      docs/parent
  8. +1
    -0
      docs/themes/book/layouts/shortcodes/file.html

+ 1
- 1
docs/config.yaml View File

@ -9,4 +9,4 @@ params:
BookDateFormat: 'Last modified Jan 2, 2006'
BookEnableJS: true
BookRepo: 'https://git.geek1011.net/geek1011/vpl'
pygmentsCodeFences: true
pygmentsCodeFences: true

+ 6
- 6
docs/content/_index.md View File

@ -16,8 +16,8 @@ type: docs
**Parent Files**
- [grader.go](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/grader.go)
- [vpl_evaluate.sh](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/vpl_evaluate.sh)
- [grader.go]({{< relref "/docs/files.md" >}})
- [vpl_evaluate.sh]({{< relref "/docs/files.md" >}})
- [vcase.py]({{< relref "/docs/reference/libraries.md" >}}#python-3)
<--->
@ -41,8 +41,8 @@ type: docs
**Parent Files**
- [grader.go](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/grader.go)
- [vpl_evaluate.sh](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/vpl_evaluate.sh)
- [grader.go]({{< relref "/docs/files.md" >}})
- [vpl_evaluate.sh]({{< relref "/docs/files.md" >}})
- [VCase.java]({{< relref "/docs/reference/libraries.md" >}}#java)
<--->
@ -66,8 +66,8 @@ type: docs
**Parent Files**
- [grader.go](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/grader.go)
- [vpl_evaluate.sh](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/vpl_evaluate.sh)
- [grader.go]({{< relref "/docs/files.md" >}})
- [vpl_evaluate.sh]({{< relref "/docs/files.md" >}})
<--->
**Reference**

+ 18
- 0
docs/content/docs/files.md View File

@ -0,0 +1,18 @@
---
title: Files
---
{{< tabs "files" >}}
{{< tab "grader.go" >}}
{{< file "parent/grader.go" "go" "style=trac" >}}
{{< /tab >}}
{{< tab "vpl_evaluate.sh" >}}
{{< file "parent/vpl_evaluate.sh" "bash" "style=trac" >}}
{{< /tab >}}
{{< tab "vcase.py" >}}
{{< file "parent/vcase.py" "python" "style=trac" >}}
{{< /tab >}}
{{< tab "VCase.java" >}}
{{< file "parent/VCase.java" "java" "style=trac" >}}
{{< /tab >}}
{{< /tabs >}}

+ 16
- 1
docs/content/docs/guide/install.md View File

@ -3,4 +3,19 @@ title: Install
---
# Installation
To install VPLGrader, you will need to create a new parent and copy [grader.go](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/grader.go), and [vpl_evaluate.sh](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/vpl_evaluate.sh) into it. TODO: detailed settings and screenshots (I can't access it anymore).
To install VPLGrader, you will need to create a new parent and copy [the parent files]({{< relref "/docs/files.md" >}}) into it. TODO: detailed settings and screenshots (I can't access it anymore).
{{< tabs "files" >}}
{{< tab "grader.go" >}}
{{< file "parent/grader.go" "go" "style=trac" >}}
{{< /tab >}}
{{< tab "vpl_evaluate.sh" >}}
{{< file "parent/vpl_evaluate.sh" "bash" "style=trac" >}}
{{< /tab >}}
{{< tab "vcase.py" >}}
{{< file "parent/vcase.py" "python" "style=trac" >}}
{{< /tab >}}
{{< tab "VCase.java" >}}
{{< file "parent/VCase.java" "java" "style=trac" >}}
{{< /tab >}}
{{< /tabs >}}

+ 2
- 119
docs/content/docs/reference/libraries.md View File

@ -15,125 +15,8 @@ See the Examples page for examples.
## Python 3
**vcase.py**
```python
class VCase(object):
def __init__(self):
self.__Title = None
self.__PassMessage = None
self.__FailMessage = None
self.__ShowPassOutput = False
self.__HideFailOutput = False
self.__ShowOutputDiff = False
self.__UseRegexp = False
self.__NormalizeWhitespace = False
self.__TrimWhitespace = False
self.__NormalizeCase = False
self.__NoShowNormalized = False
self.__Marks = 1
self.__Input = ""
self.__Output = ""
def title(self, v: str):
self.__Title = v
def pass_message(self, v: str):
self.__PassMessage = v
def fail_message(self, v: str):
self.__FailMessage = v
def show_pass_output(self, v: bool):
self.__ShowPassOutput = v
def hide_fail_output(self, v: bool):
self.__HideFailOutput = v
def show_output_diff(self, v: bool):
self.__ShowOutputDiff = v
def use_regexp(self, v: bool):
self.__UseRegexp = v
def normalize_whitespace(self, v: bool):
self.__NormalizeWhitespace = v
def trim_whitespace(self, v: bool):
self.__TrimWhitespace = v
def normalize_case(self, v: bool):
self.__NormalizeCase = v
def no_show_normalized(self, v: bool):
self.__NoShowNormalized = v
def marks(self, v: int):
self.__Marks = v
def input(self, v: object):
self.__Input += str(v) + "\n"
def output(self, v: object):
self.__Output += str(v) + "\n"
def done(self):
self.__print_kv("Title", self.__Title)
self.__print_kv("PassMessage", self.__PassMessage)
self.__print_kv("FailMessage", self.__FailMessage)
self.__print_kv("ShowPassOutput", self.__ShowPassOutput)
self.__print_kv("HideFailOutput", self.__HideFailOutput)
self.__print_kv("ShowOutputDiff", self.__ShowOutputDiff)
self.__print_kv("UseRegexp", self.__UseRegexp)
self.__print_kv("NormalizeWhitespace", self.__NormalizeWhitespace)
self.__print_kv("TrimWhitespace", self.__TrimWhitespace)
self.__print_kv("NormalizeCase", self.__NormalizeCase)
self.__print_kv("NoShowNormalized", self.__NoShowNormalized)
self.__print_kv("Marks", self.__Marks)
print("---")
print(self.__Input + "---")
print(self.__Output + "===")
print()
def __print_kv(self, key, value):
if value is not None:
print(f"{key} = {value}")
```
{{< file "parent/vcase.py" "python" "" >}}
## Java
**VCase.java**
```java
public class VCase {
private String mTitle = null;
private String mPassMessage = null;
private String mFailMessage = null;
private boolean mShowPassOutput = false;
private boolean mHideFailOutput = false;
private boolean mShowOutputDiff = false;
private boolean mUseRegexp = false;
private boolean mNormalizeWhitespace = false;
private boolean mTrimWhitespace = false;
private boolean mNormalizeCase = false;
private boolean mNoShowNormalized = false;
private int mMarks = 1;
private String mInput = "";
private String mOutput = "";
public void title(String v) { this.mTitle = v; }
public void pass_message(String v) { this.mPassMessage = v; }
public void fail_message(String v) { this.mFailMessage = v; }
public void show_pass_output(boolean v) { this.mShowPassOutput = v; }
public void hide_fail_output(boolean v) { this.mHideFailOutput = v; }
public void show_output_diff(boolean v) { this.mShowOutputDiff = v; }
public void use_regexp(boolean v) { this.mUseRegexp = v; }
public void normalize_whitespace(boolean v) { this.mNormalizeWhitespace = v; }
public void trim_whitespace(boolean v) { this.mTrimWhitespace = v; }
public void normalize_case(boolean v) { this.mNormalizeCase = v; }
public void no_show_normalized(boolean v) { this.mNoShowNormalized = v; }
public void marks(int v) { this.mMarks = v; }
public void input(String v) { this.mInput += v + "\n"; }
public void output(String v) { this.mOutput += v + "\n"; }
public void done() {
this.print_kv("Title", this.mTitle);
this.print_kv("PassMessage", this.mPassMessage);
this.print_kv("FailMessage", this.mFailMessage);
this.print_kv("ShowPassOutput", this.mShowPassOutput);
this.print_kv("HideFailOutput", this.mHideFailOutput);
this.print_kv("ShowOutputDiff", this.mShowOutputDiff);
this.print_kv("UseRegexp", this.mUseRegexp);
this.print_kv("NormalizeWhitespace", this.mNormalizeWhitespace);
this.print_kv("TrimWhitespace", this.mTrimWhitespace);
this.print_kv("NormalizeCase", this.mNormalizeCase);
this.print_kv("NoShowNormalized", this.mNoShowNormalized);
this.print_kv("Marks", this.mMarks);
System.out.println("---");
System.out.println(this.mInput + "---");
System.out.println(this.mOutput + "===");
System.out.println();
}
private void print_kv(String k, String v) { if (v != null) System.out.printf("%s = %s\n", k, v); }
private void print_kv(String k, boolean v) { System.out.printf("%s = %b\n", k, v); }
private void print_kv(String k, int v) { System.out.printf("%s = %d\n", k, v); }
}
```
{{< file "parent/VCase.java" "java" "" >}}

+ 3
- 8
docs/content/menu/index.md View File

@ -16,11 +16,6 @@ headless: true
- [Python]({{< relref "/docs/examples/python.md" >}})
- [Java]({{< relref "/docs/examples/java.md" >}})
<br>
<br>
<br>
<br>
- **Parent Files**
- [grader.go](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/grader.go)
- [vpl_evaluate.sh](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent/vpl_evaluate.sh)
- [vcase.py]({{< relref "/docs/reference/libraries.md" >}}#python-3)
- [VCase.java]({{< relref "/docs/reference/libraries.md" >}}#java)
- **Files**
- [View]({{< relref "/docs/files.md" >}})
- [Git Repository](https://git.geek1011.net/geek1011/vpl/src/branch/master/parent)

+ 1
- 0
docs/parent View File

@ -0,0 +1 @@
../parent

+ 1
- 0
docs/themes/book/layouts/shortcodes/file.html View File

@ -0,0 +1 @@
{{ highlight (readFile (.Get 0)) (.Get 1) (.Get 2) }}

Loading…
Cancel
Save