diff --git a/README.md b/README.md index d815941..6a9fe8e 100644 --- a/README.md +++ b/README.md @@ -12,23 +12,19 @@ With [some work](doc/extend.md), you can also: - include your own annotations - include the ASOP, complete with clickable links to each rule -*NOTE: This project integrates with my other [`asl-articles`](https://github.com/pacman-ghost/asl-articles) project, so that if an article references a rule, it becomes a clickable link that will open a browser showing that rule.* +*NOTE: The program requires Firefox; Chrome doesn't support a key feature it needs.* + +*NOTE: This project integrates with my other [`asl-articles`](https://github.com/pacman-ghost/asl-articles) project, so that if an article references a rule, it becomes a clickable link that will open a browser showing that rule. The [`vasl-templates`](https://github.com/pacman-ghost/vasl-templates) project can also be configured to allow vehicles and ordnance to open their corresponding Chapter H entries.* ### Installation After cloning the repo, you can either: -- run it using Docker (recommended, run `./run-container.sh`) +- run it using Docker (recommended, run `./run-container.sh --port 5020`) - run it from source (requires Python 3.8.7, install the module, run `asl_rulebook2/webapp/run_server.py`) -*NOTE: Run either command with no arguments to get help.* - -Run either command with a `--port` argument, then connect to the server in a browser e.g. - -``` ./run-container.sh --port 5020 ``` - -Then open `http://localhost:5020`. +*NOTE: Run either command with `--help` to get help.* -*NOTE: The program requires Firefox; Chrome doesn't really support a key feature it needs.* +Then connect to the server in a browser at `http://localhost:5020`. A few things need to be set up before the program can be used; the webapp will guide you through the process. diff --git a/asl_rulebook2/webapp/main.py b/asl_rulebook2/webapp/main.py index cdffe88..b71bb7e 100644 --- a/asl_rulebook2/webapp/main.py +++ b/asl_rulebook2/webapp/main.py @@ -41,6 +41,9 @@ def get_control_tests(): def get_port(): """Get the configured gRPC service port.""" # NOTE: The Docker container configures this setting via an environment variable. + # NOTE: It would be nice to default this to -1, so that pytest will work out-of-the-box, + # without the user having to do anything, but since this endpoint can be used to + # mess with the server, we don't want it active by default. return app.config.get( "CONTROL_TESTS_PORT", os.environ.get("CONTROL_TESTS_PORT") ) # check if the test control service should be made available diff --git a/asl_rulebook2/webapp/rule_info.py b/asl_rulebook2/webapp/rule_info.py index 999f7bd..d213809 100644 --- a/asl_rulebook2/webapp/rule_info.py +++ b/asl_rulebook2/webapp/rule_info.py @@ -116,7 +116,7 @@ def init_qa( startup_msgs, logger ): # --------------------------------------------------------------------- def init_annotations( startup_msgs, logger ): - """Initialize the user-defined annoations.""" + """Initialize the user-defined annotations.""" # initialize global _user_anno diff --git a/doc/extend.md b/doc/extend.md index 70beee1..66867d9 100644 --- a/doc/extend.md +++ b/doc/extend.md @@ -36,9 +36,9 @@ All the files should have the same base filename e.g. - kgs.targets - etc... -### Adding Q+A, errata, user annoations, ASOP +### Adding Q+A, errata, user annotations, ASOP -This is described [here](../asl_rulebook2/webapp/tests/fixtures/full/). +This is described in `$/asl_rulebook2/webapp/tests/fixtures/full/`. *NOTE: If you add Q+A, there is a tool in `$/asl_rulebook2/bin/qa-helper/` to help with the process.* diff --git a/doc/features/images/chapters-extended.png b/doc/features/images/chapters-extended.png index f788acd..df6dc1a 100644 Binary files a/doc/features/images/chapters-extended.png and b/doc/features/images/chapters-extended.png differ diff --git a/doc/features/index.html b/doc/features/index.html index c8863c2..54be82c 100644 --- a/doc/features/index.html +++ b/doc/features/index.html @@ -28,15 +28,15 @@

Adding rules for other modules

Once you've got the program up and running, you can then think about extending it. It's a lot of work, but the results are insanely cool! -

To the right, I searched for "cellar", and the program has found results from Red Barricades. The rules for this are referenced in the ASLRB index, but the content is not yet in the MMP eASLRB. -

However, I added a PDF scan of the rules, plus information about where each rule is within that PDF (a "targets file"), and so when I click on the O3.3 search result, it seamlessly opens the Red Barricades PDF and jumps to that rule. +

To the right, I've searched for "cellar", and the program has found results from Red Barricades. The rules for this are referenced in the ASLRB index, but the content is not yet in the MMP eASLRB. +

However, I've installed a PDF scan of the rules, plus information about where each rule is within that PDF (a "targets file"), and so when I click on a search result, it seamlessly opens the Red Barricades PDF and jumps to that rule.

-You can also include third-party modules that are not referenced in the ASLRB index, in this case, LFT's Kampfgruppe Scherer. I added an index for it, which is then also searched. As with Red Barricades, I also added a PDF scan of the rules, and a targets file that specifies the location of each rule, and clicking on the KGS CG9 search result takes me directly to that rule in the KGS PDF. +You can also include third-party modules that are not referenced in the ASLRB index. I've also installed a PDF of LFT's Kampfgruppe Scherer, a targets files for it, and also an index file. This last file is also searched, and clicking on a search result takes me directly to the associated rule in the KGS PDF.
-

I also added information about chapters in the PDF's, so that I can browse through them in the usual way:
+

I've also added information about chapters in the PDF, so that I can browse through them in the usual way:


diff --git a/doc/prepare.md b/doc/prepare.md index d991b51..441a9b6 100644 --- a/doc/prepare.md +++ b/doc/prepare.md @@ -49,13 +49,12 @@ Finally, we need to fixup some issues in the PDF: --output /tmp/prepared/ASL\ Rulebook.pdf \ --progress ``` -This rotates any landscape pages, so that the browser shows pages at the correct width (without a horizontal scrollbar). +This rotates any landscape pages, so that the browser shows pages at the correct width (without a horizontal scrollbar), and optimizes the PDF for use in a browser. ### Using the prepared files You should now have 6 files (the 5 extracted data files, plus the fixed-up PDF), which can be passed in to the program e.g. ``` ./run-container.sh \ - --port 5020 \ --data /tmp/prepared/ ```