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

Add support for the building the manual with a Visual Studio Code development container #557

Merged
merged 1 commit into from Jan 8, 2022

Conversation

YoRyan
Copy link
Member

@YoRyan YoRyan commented Dec 26, 2021

Visual Studio Code's development containers feature allows us to construct a reproducible, well-defined Linux toolstack to work with our code on our Windows machines. It's the perfect technology to apply to our manual; rather than installing and maintaining the full Python/Sphinx/LaTeX stack, you can let VS Code and Docker do all the work for you!

To use the feature:

  1. Install the Dev Containers extension for VS Code and Docker Desktop for Windows 10/11. Start Docker Desktop.
  2. In VS Code, press F1 and search for the "Open Folder in Container" command. Browse to the Source\Documentation\Manual folder. After opening the workspace, VS Code will pull the Docker image straight from Sphinx and spin it up.
  3. Press Ctrl+Shift+B to build the HTML version of the manual. And that's it! The files will output to the _build directory, just as if you'd used Sphinx for Windows. (Under Terminal > Run Task, I've also included commands to build the PDF manual and to clean the output directory.)

This will hopefully make it much easier for other developers and interested power users to contribute to our manual.

Caveat: You're normally able to use VS Code's Git integration in a development container, but it doesn't work for our use case. That's because the manual is located in a subdirectory, and VS Code doesn't yet detect development container workspaces within subdirectories (microsoft/vscode-remote-release#2413), so you can't open the openrails root folder and get full Git integration. One possible workaround would be to spin off the manual to separate repository, as we are doing for the website.

@YoRyan YoRyan added documentation Improvements or additions to documentation infrastructure Improvements or additions to building, hosting, and other project infrastructure labels Dec 26, 2021
twpol pushed a commit that referenced this pull request Dec 26, 2021
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at 3135da4: Initial Virtual File System development
- Pull request #542 at 83320ed: adds new webpage, moves Testing out of Download/Programs
- Pull request #543 at 5b0121c: adds Discover > Roadmap webpage
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #548 at eb4b560: Links to dead Siskiyou site removed
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at fbb4773: Improve memory statistics for CPU and GPU
- Pull request #557 at 2f7b7d4: Add support for the building the manual with a Visual Studio Code development container
twpol pushed a commit that referenced this pull request Dec 26, 2021
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at 3135da4: Initial Virtual File System development
- Pull request #542 at 83320ed: adds new webpage, moves Testing out of Download/Programs
- Pull request #543 at 5b0121c: adds Discover > Roadmap webpage
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #548 at eb4b560: Links to dead Siskiyou site removed
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at fbb4773: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
twpol pushed a commit that referenced this pull request Dec 26, 2021
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at 3135da4: Initial Virtual File System development
- Pull request #542 at 83320ed: adds new webpage, moves Testing out of Download/Programs
- Pull request #543 at 5b0121c: adds Discover > Roadmap webpage
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at fbb4773: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #558 at 68a8700: Revised Visual Studio version
@cjakeman
Copy link
Contributor

Hi Ryan,

It's the perfect technology to apply to our manual; rather than installing and maintaining the full Python/Sphinx/LaTeX stack, you can let VS Code and Docker do all the work for you!

This sounds so much better than what we're currently doing. Many thanks. Will try it as soon as i have a moment.

One possible workaround would be to spin off the manual to separate repository, as we are doing for the website.

Thanks for suggesting a workaround, but I would argue against something that divorced the Manual from the code. At present, changes to the Manual are the first item on my checklist when reviewing a code PR. If they're in a different repository, I expect they would often be skipped.

twpol pushed a commit that referenced this pull request Dec 27, 2021
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at 3135da4: Initial Virtual File System development
- Pull request #542 at 83320ed: adds new webpage, moves Testing out of Download/Programs
- Pull request #543 at 5b0121c: adds Discover > Roadmap webpage
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #558 at 68a8700: Revised Visual Studio version
twpol pushed a commit that referenced this pull request Dec 27, 2021
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at 3135da4: Initial Virtual File System development
- Pull request #542 at 83320ed: adds new webpage, moves Testing out of Download/Programs
- Pull request #543 at 5b0121c: adds Discover > Roadmap webpage
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #558 at 68a8700: Revised Visual Studio version
- Pull request #559 at aaeb251: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
twpol pushed a commit that referenced this pull request Dec 28, 2021
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at 3135da4: Initial Virtual File System development
- Pull request #542 at 83320ed: adds new webpage, moves Testing out of Download/Programs
- Pull request #543 at 5b0121c: adds Discover > Roadmap webpage
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #558 at 68a8700: Revised Visual Studio version
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
twpol pushed a commit that referenced this pull request Jan 2, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #527 at fac005e: Brake cuts power refactor and new parameters
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
twpol pushed a commit that referenced this pull request Jan 2, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #537 at e753905: C# signal script extensions
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
twpol pushed a commit that referenced this pull request Jan 3, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
twpol pushed a commit that referenced this pull request Jan 3, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
- Pull request #562 at 44f35b4: Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
twpol pushed a commit that referenced this pull request Jan 4, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
- Pull request #562 at 44f35b4: Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
- Pull request #563 at 9f1cd64: Correct a timing issue in Eames brakes
twpol pushed a commit that referenced this pull request Jan 4, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
- Pull request #562 at 44f35b4: Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
- Pull request #563 at 9f1cd64: Correct a timing issue in Eames brakes
- Pull request #565 at ebcd9e8: Correct Steam locomoti starting tractive effort.
twpol pushed a commit that referenced this pull request Jan 4, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
- Pull request #562 at 44f35b4: Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
- Pull request #563 at 9f1cd64: Correct a timing issue in Eames brakes
- Pull request #565 at ebcd9e8: Correct Steam locomoti starting tractive effort.
- Pull request #566 at b022de2: Fix for https://bugs.launchpad.net/or/+bug/1956262. F5 causes OR crash.
twpol pushed a commit that referenced this pull request Jan 4, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
- Pull request #562 at 44f35b4: Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
- Pull request #563 at 9f1cd64: Correct a timing issue in Eames brakes
- Pull request #565 at ebcd9e8: Correct Steam locomoti starting tractive effort.
- Pull request #566 at 04d1bb7: Fix for https://bugs.launchpad.net/or/+bug/1956262. F5 causes OR crash.
twpol pushed a commit that referenced this pull request Jan 6, 2022
- Pull request #525 at 614b222: TCS extensions
- Pull request #533 at 62a1c27: fix for shapes hidden by animations( 0 )
- Pull request #541 at febc605: Initial Virtual File System development
- Pull request #545 at d85b4ed: Fix VRAM usage
- Pull request #551 at 0aa1e46: Make handling the timetable-or extension consistent.
- Pull request #554 at 3329168: Bug fix for Crash when switching cabs and changing screen page  https://bugs.launchpad.net/or/+bug/1955575
- Pull request #555 at 5270648: Bug fix for crash with diesel locos with more than an engine, https://bugs.launchpad.net/or/+bug/1955582
- Pull request #556 at afe2069: Improve memory statistics for CPU and GPU
- Pull request #557 at f931073: Add support for the building the manual with a Visual Studio Code development container
- Pull request #559 at 9e80053: https://blueprints.launchpad.net/or/+spec/distributed-power: Distributed power cab display and controls
- Pull request #560 at 46a143d: https://blueprints.launchpad.net/or/+spec/label-for-cab-controls , by Jindrich
- Pull request #561 at 36dcd19: Manual call-on is reset when passing an advanced signal - https://bugs.launchpad.net/or/+bug/1955907
- Pull request #562 at 44f35b4: Remove the locomotive handle from the script, because no interface function can allow access to any internal structure.
- Pull request #563 at 59a0e1c: Correct a timing issue in Eames brakes
- Pull request #565 at ebcd9e8: Correct Steam locomoti starting tractive effort.
- Pull request #566 at 04d1bb7: Fix for https://bugs.launchpad.net/or/+bug/1956262. F5 causes OR crash.
@cjakeman
Copy link
Contributor

cjakeman commented Jan 8, 2022

Hi Ryan,

All worked well for me. I've added some extra notes below for anyone else who wants to try it.

1. Install the Remote Containers extension for VS Code and Docker Desktop for Windows 10/11. Start Docker Desktop.

In my case, installing Docker Desktop also prompted for the WSL 2 Linux kernel.
Make sure Docker Desktop is running before you start Visual Studio Code.

2. In VS Code, press F1 and search for the "Open Folder in Container" command. Browse to the Source\Documentation\Manual folder. After opening the workspace, VS Code will pull the Docker image straight from Sphinx and spin it up.

It's "Remote-Containers: Open Folder in Container"
This takes some time on first use, so be patient.

3. Press Ctrl+Shift+B to build the HTML version of the manual. And that's it! The files will output to the _build directory, just as if you'd used Sphinx for Windows. (Under Terminal > Run Task, I've also included commands to build the PDF manual and to clean the output directory.)

Ctrl+Shift+B is a shortcut for running the default task in the Terminal window, in this case "make html" and you can browse the results at "Source\Documentation\Manual_build\html\index.html"

In the Terminal window, enter "make latexpdf" to build "Source\Documentation\Manual_build\latex\Manual.pdf"

Copy link
Contributor

@cjakeman cjakeman left a comment

Choose a reason for hiding this comment

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

Works very well. No issues.

Approved with thanks,

Chris

@cjakeman cjakeman merged commit e3e322f into openrails:master Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation infrastructure Improvements or additions to building, hosting, and other project infrastructure
2 participants