Add a workflow to generate and publish PG POD and sample problem documentation. #1346
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.
This is intended to replace the openwebwork/pg-docs repository. The approach in that repository has some issues.
bin/dev_script/generate-ww-pg-pod.plscript from the webwork2 repository to generate the PG and webwork2 POD, and the webwork2 POD should not be on a site that is intended for PG documentation. Furthermore, the generated html POD site does not fit into the PG documentation site well. For, example there is no link to get back to the main PG documentation index page, and it is labeled as WeBorK documentation, not PG documentation.The single workflow added in this pull request runs anytime anything is merged into the main branch. It can also be manually triggered but that generally won't be needed. This means that anytime a new version of PG is released the documentation will automatically be updated for that release.
The workflow generates the PG POD and sample problem documentation and publishes the documentation to the PG GitHub pages site at https://openwebwork.github.io/pg. The generated documentation is not committed to a repository. It is published to the pages site, and that is enough.
A new
bin/generate-pg-pod.plscript is added that generates only the PG POD. The generated html is tailored for the PG documentation on GitHub pages. There is some minor redundancy as there are some files that are now in both the webwork2 and PG repositories (needed for both thegenerate-ww-pg-pod.plandgenerate-pg-pod.plscripts). However, it certainly would not be a good idea to have the PG repository depend on the webwork2 repository for thegenerate-ww-pg-pod.plscript, and as mentioned that script doesn't really generated the right HTML to begin with.Move the
SampleProblemParsermodule into theWeBWorK::PGnamespace. All of the other modules in the root namespace in the PG repository are directly for problem rendering except this one. It is out of place. So it is now theWeBWorK::PG::SampleProblemParsermodule.Change the options for the
parser-problem-doc.plscript and theWeBWorK::PG::SampleProblemParsermodule. Using underscores for options is annoying. Underscores require an extra keyboard button press (the shift key), and underscore are not standard for command line options. Also thepod_rootandpg_doc_homeoptions are badly named. Thepod_rootoption name seems to indicate it should be the directory location for the POD, but it is a URL. So make that clear by renaming it topod-base-url. Thepg_doc_homeis not the URL for the PG documentation home, but for the sample problem base URL. So rename that tosample-problem-base-url(and its shortcut from "h" to "s"). Also change the corresponding variable names in theSampleProblemParser.pmmodule.Copy the PODParser.pm and PODtoHTML.pm modules from the webwork2 repository to lib/WeBWorK/Utils where webwork2 can also use them. Those modules will be deleted from the webwork2 repository.
Copy podviewer.css and podviewer.js from the webwork2 repository into htdocs/js/PODViewer, also where webwork2 can use them. The files will be deleted from the webwork2 repository.
Copy the bin/dev_scripts/pod-templates category-index.mt and pod.mt files into assets/pod-templates here, and make changes to the files so that they will work for both webwork2 and pg. The files will also be deleted from the webwork2 repository.
Add the sample problem and macro POD search to PG docs. The sample problem and macro POD search data is generated by the
WeBWorK::PG::SampleProblemParser::getSearchDatamethod. This is used by webwork2 and thebin/generate-search-data.plscript. The script is very simple. It just calls the method passing in the file name to save the data to. The workflow runs the script and copies the resulting file to the PG github pages site.The
assets/stop-words-en.txtfile is moved here from the webwork2 repository since theWeBWorK::PG::SampleProblemParser::getSearchDataneeds it.The
htdocs/js/SampleProblemViewer/documentation-search.jsis moved from the webwork2 repository (webwork2 uses it from here now), and this is also copied to the PG github pages site in the workflow. It is slightly modified to work for both webwork2 and on the PG github pages site.The necessary changes to the webwork2 repository are in openwebwork/webwork2#2842.