Markus makes the good point that it would be nice for visitors to be able to download example.py source files for our tutorial examples. The trick with this will be to avoid duplicating the code. Ideally, we'd have a directory with tutorial examples and they'd be injected into the ReST as part of the build process.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
That's great, thanks! Please keep in mind that the main trick behind this is doing something smart. The simple solution (make a copy of the tutorial example code) is easy, but unmaintainable. Rather, we'll want something smart to happen when you type 'make html' to build the site.
Yes, just making a simple copy of the tutorial example is not a good thing to do. This way, whenever we change the example, we have to change the copy too.
As the ticket description says, I was thinking about having the code in one file and once we 'make html', the code will be read from that file and added to the .html files.
Great, sounds perfect! Depending on how this is implemented this might address #10036 (closed) too since our unit tests could read examples from the file and exercise them with eval().
I have added the downloadable option for all the tutorials and it can be seen at https://github.com/sammyshj/stem/pull/3
If the code looks good, I will squash the commits into one and attach the final patch to this ticket.
Thanks
Fantastic work, Sambuddha! No need to squash 'em down, I went ahead and merged your branch as-is. Nice direction from here would be for our test/unit/tutorial.py to exec() these rather than bundle a duplicate, but that can be on another ticket.
Nice work!
Trac: Resolution: N/Ato implemented Status: new to closed