-
Notifications
You must be signed in to change notification settings - Fork 220
Quick dirty html build #2329
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
base: master
Are you sure you want to change the base?
Quick dirty html build #2329
Conversation
|
@rbeezer @oscarlevin Our discussion in drop in mostly assumed quick and dirty would in fact be dirty. Since it is cleaner than expected, it might make sense to always enable it when For the CLI, the case seems stronger to make building a subset always use quick and dirty. Possibly with an opt-out switch and a message that subset building is not guaranteed to be artifact free. |
|
Kind of jumping in to the middle here, but I'm seeing a potential use case on Runestone. An instructor types in a question in PreTeXt, we take the PreTeXt and add it to a mimimal book, where we then build the subset of that book containing this one exercise. Looks like it could be quite fast! Then we extract the generated html to preview and save to the DB. This is essentially what we do today, but I think we could do it with the cli and not have to spin up another process. |
520711f to
1a31af3
Compare
|
Rebased and updated against master post @rbeezer update to Runestone logic. Retested. |
1a31af3 to
58eaee9
Compare
|
Force push after rebase on current master |
1ccfcbe to
7c7f259
Compare
|
Force push after rebase to recent version of master |
|
This has merge conflicts I can't work out on my own. First one is with the addition of hooks to allow |
7c7f259 to
3a4ebfd
Compare
|
Rebased and cleaned up. Merged fixups into existing commits and force pushed. Pretty sure about logic for integrating with @oscarlevin's portable code. It makes the first choice - include files or not. If including files, then quick and dirty does its check. I'm on the fence re: skipping My sample-book build: |
|
Stock ~2.5s So little cost in copying the managed directories. Which side of the fence are you on now? Do we want build_or_copy_theme()? Maybe in the quick-dirty case we just try a copy from the pre-built un-minified versions? Let's do a more careful job of defining Just a first pass - there's a bit more I want to look at. |
|
Great, will modify to always copy managed dirs and clean up flag. Strongly think theme should not be built/copied. If you are using a custom theme it would be actively confusing/bad to had a pre-built swapped in. IMO quick and dirty is for rapidly previewing content changes, not for seeing changes to theme or major structural options. |
|
Well, with I'm not 100% clear on the use case for this anyway. We can chat Friday morning? |
|
Yes, we can discuss tomorrow. For the record here, the feature is now more "incremental build" than "quick and dirty build". It assumes you have already built the book and are just looking to see how some small set of changes to the source change the output. My standard authoring setup at this point is to have nodemon watch my source directory for changes and do a quick and dirty build to the chapter I am working on every time I change the source. It isn't quite live preview, but it is darn close. I think setting up something like that as an option in the CLI would be quite popular. |
Good, that makes more sense than whatever I was thinking. ;-) For the record, let's think of changing the name of the string parameter. |
|
Maybe this should be on Now, a source file is edited. The mapping takes the ID of the root element of that file and figures out which output chunk reflects the edit. That ID becomes the Then maybe Python can manage the monitoring and rebuilding on some port/server...? |
|
I like it. But I think that is a separate PR (that is matched with a CLI PR to consume that data). |
|
Just pushed another commit. Not intended as final code - lots of extra timing messages. Converted to draft while code isn't final. Extended notes here as we probably will have a lull before next discussing this. Note: Changes:
The logic for
The code in the Current stats on my machine, native Windows: A front end does need to know what to rebuild. To avoid the user having to specify an xml:id as part of the "start watching" command, we will need something like Rob's clever mapping. That could be built once as part of the "one time startup" code. |
3e3fea4 to
1f4bce9
Compare
|
Visual scan while away from a real machine. (Not because you just happened to push.) I'll need to look closer, and a chat might help. WeBWorK in assembly already has me concerned, so I need to look closely at which tree is being used. |
|
I'm still working. Will add a comment and mark "Ready for review" when I think it is worth a deeper look. |
1f4bce9 to
84d611a
Compare
|
Done with cleanups. I think this is ready for serious review Broke the functionality into two features:
Assembly tree change should only affect later levels when use ol-markers generating directory when needed seems unrelated, but lack of dir caused an issue at one point for me. |
|
Recent timing tests. TourCS book - Using windows on windows file system: TourCS book - Using WSL build on windows file system: |
|
Rebase against more recent master. All looks good. |
84d611a to
e114bba
Compare
e114bba to
c2a4365
Compare
|
Rebase. |
c2a4365 to
c84df04
Compare
|
Rebase to a0d5516 |
I rebased this code off of #2328 as the logic re: runestone-services overlaps and that other PR seems more fundamental.
This adds
html.quick-dirtystring param. It cuts out build steps when used on its own. When used with-rit prunes the source tree early in the assembly phase and really shines.The results are not all that dirty... quick and dirty produces clean diffs.