-
Notifications
You must be signed in to change notification settings - Fork 182
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
Versioned webpage using commit directories #101
Conversation
a883441
to
b18f8b4
Compare
Did not use jekyll-redirect-from since it seems it would use the same technique, but would be less versatile. https://stackoverflow.com/questions/9276817/301-redirect-for-site-hosted-at-github#comment57813956_32465659 redirect-template.html based off of https://stackoverflow.com/questions/9276817/301-redirect-for-site-hosted-at-github#comment57813956_32465659
Not tested on case where pathspec v exists
Requires manubot to set variables ci_source.repo_owner and ci_source.repo_name. Hence, upgrade to manubot/manubot@2745659
Testing this in a manubot instance at https://github.com/dhimmel/code-96. Will cherry-pick additional commits from that repo back to this PR, when things are all working. Seems to be mostly working. Remaining issues:
|
ghp-import did not push symlinks within directory. However, the versioned directory setup requires symlinks to operate as intended. Refs c-w/ghp-import#37
Uses empty branch technique from a previous Manubot setup script: https://github.com/greenelab/manubot-rootstock/blob/f82ae0dc1a059bce05a8c43c0bf5e6a58edc4f2c/initialize.sh
completed
Yes. completed
This PR now works (see https://github.com/dhimmel/code-96) even though ghp-import doesn't preserve symlinks. If ghp-import implements an option to preserve symlinks, the diffs on the @agitter ready for review |
Okay. I'll likely need a few days to get to this. |
Here's an example commit on what upgrading OTS stamps now looks like dhimmel/code-96@8dae193. Requires a bitcoin full node. |
I created a script https://gist.github.com/dhimmel/5cf98acc58f60ede9504422e7a0a9f41 that will take a legacy gh-pages and create version directories for past commits. This is not required, but allows you to pull out historical versions into their own directories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall. I only have questions and some minor comments.
webpage/README.md
Outdated
The [`v`](v) directory contains directories for each manuscript version. | ||
In general, a version is identified by the commit hash of the source content that created it. | ||
The `*.ots` files in version directories are OpenTimestamps which can be used to verify manuscript existence at or before a given time. | ||
[OpenTimestamps](opentimestamps.org) uses the Bitcoin blockchain to attest to file hash existence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is being treated as a relative link.
--checkout=gh-pages \ | ||
--version=$TRAVIS_COMMIT | ||
|
||
# Generate OpenTimestamps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to make sure I understand the timestamping strategy. We still timestamp in the same way without --wait
because we want to CI deploy script to terminate quickly. However, we now have the ability to manually update all of the OTS Timestamps whenever we want as you did in dhimmel/code-96@8dae193 without rewriting history. After the upgrade, those timestamps are no longer dependent on the calendar service.
Is that correct? Do we need to document the upgrade instructions somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes your understanding is correct. --wait
is not feasible for CI builds as it could take days IIRC. Will document.
README.md
Outdated
@@ -53,6 +53,9 @@ sh build/build.sh | |||
# when a change is detected. | |||
sh build/autobuild.sh | |||
|
|||
# Configure the webpage directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be an optional step for a local build. If sh build/build.sh
is still the minimal command needed to build the PDF and HTML manuscripts, we may want to indicate that more explicitly in the script comments or preceding text.
webpage/README.md
Outdated
+ `*.ots` files are OpenTimestamps which can be used to verify manuscript existence at or before a given time. | ||
[OpenTimestamps](opentimestamps.org) uses the Bitcoin blockchain to attest to file hash existence. | ||
|
||
The [`v`](v) directory contains directories for each manuscript version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want v
to be a link if it is ignored on master?
This build is based on 29cd993. This commit was created by the following Travis CI build and job: https://travis-ci.org/greenelab/manubot-rootstock/builds/342477457 https://travis-ci.org/greenelab/manubot-rootstock/jobs/342477458 [ci skip] The full commit message that triggered this build is copied below: Versioned webpage using commit directories (#101) Closes #96
This build is based on 29cd993. This commit was created by the following Travis CI build and job: https://travis-ci.org/greenelab/manubot-rootstock/builds/342477457 https://travis-ci.org/greenelab/manubot-rootstock/jobs/342477458 [ci skip] The full commit message that triggered this build is copied below: Versioned webpage using commit directories (#101) Closes #96
Note the |
I think there may be an issue with this commit. I'll be brief because I have to run, but can fill in details later if the fix is not obvious to you. I'm running locally with I can dig deeper later, if you are unable to confirm this behavior. FWIW, here is the output of Retrieving and processing reference metadata
## INFO
Manuscript content parts:
00.front-matter
01.recent-observations
99.back-matter
## INFO
0 unique citations strings extracted from text
0 unique standard citations
## INFO
requests-cache starting with 0 cached responses
## INFO
requests-cache finished with 0 cached responses
## INFO
Using UTC timezone.
Dating manuscript with the current datetime: 2018-02-17T01:15:54.189811+00:00
## INFO
Reading user-provided templating variables complete:
{}
## INFO
Generated manscript stats:
{
"reference_counts": {
"total": 0
},
"word_count": 1361
}
Exporting HTML manuscript
Exporting PDF manuscript
WARNING: Ignored `-ms-text-size-adjust: 100%` at 78:5, unknown property.
WARNING: Ignored `-webkit-text-size-adjust: 100%` at 79:5, unknown property.
WARNING: Ignored `-moz-box-sizing: content-box` at 204:5, unknown property.
WARNING: Ignored `-webkit-appearance: button` at 379:5, unknown property.
WARNING: Ignored `cursor: pointer` at 380:5, the property does not apply for the print media.
WARNING: Ignored `cursor: default` at 389:5, the property does not apply for the print media.
WARNING: Ignored `-webkit-appearance: textfield` at 410:5, unknown property.
WARNING: Ignored `-moz-box-sizing: content-box` at 411:5, unknown property.
WARNING: Ignored `-webkit-box-sizing: content-box` at 412:5, unknown property.
WARNING: Ignored `-webkit-appearance: none` at 423:5, unknown property.
WARNING: Invalid or unsupported selector 'button::-moz-focus-inner,
input::-moz-focus-inner ', Unknown pseudo-element: -moz-focus-inner
WARNING: Invalid or unsupported selector '*:not("#mkdbuttons") ', (<FunctionBlock not( … )>, ':not() only accepts a simple selector')
WARNING: Ignored `-webkit-font-smoothing: subpixel-antialiased` at 486:5, unknown property.
WARNING: Ignored `-moz-border-radius: 3px` at 491:5, unknown property.
WARNING: Ignored `-webkit-border-radius: 3px
` at 492:5, unknown property.
WARNING: Ignored `-webkit-font-smoothing: subpixel-antialiased` at 528:5, unknown property.
WARNING: Ignored `cursor: text
` at 529:5, the property does not apply for the print media.
WARNING: Ignored `word-break: break-all` at 733:5, unknown property.
WARNING: Ignored `word-break: break-word` at 734:5, unknown property.
WARNING: Ignored `-webkit-hyphens: auto` at 735:5, unknown property.
WARNING: Ignored `-moz-hyphens: auto` at 736:5, unknown property.
Build complete
|
Thanks for the report @slochower. You need to run the following to touch the python build/webpage.py Previously, Sorry to break your autobuild workflow. How useful have you found the autobuild script? Since webpage.py accepts arguments, it's not entirely clear to me how we should fix it. Probably just add |
Thanks for the quick reply. Interesting change. I agree that we should probably put I mostly use this local workflow when I want to see my rendered document (for example, if I have a bunch of equations and figures). This comes in handy for more informal cases than writing a collaborative manuscript. Sometimes I want to write a complicated email with figures and syntax highlighting and so I start one of these Markdown documents -- but it doesn't make sense to use an existing |
Most autobuild users will want to automatically update the webpage. See discussion at manubot#101 (comment) Update README to better document autobuild.
Most autobuild users will want to automatically update the webpage. See discussion at #101 (comment) Update README to better document autobuild.
This build is based on b7a9de8. This commit was created by the following Travis CI build and job: https://travis-ci.org/greenelab/manubot-rootstock/builds/342797312 https://travis-ci.org/greenelab/manubot-rootstock/jobs/342797313 [ci skip] The full commit message that triggered this build is copied below: autobuild.sh: include webpage.py execution (#113) Most autobuild users will want to automatically update the webpage. See discussion at #101 (comment) Update README to better document autobuild.
This build is based on b7a9de8. This commit was created by the following Travis CI build and job: https://travis-ci.org/greenelab/manubot-rootstock/builds/342797312 https://travis-ci.org/greenelab/manubot-rootstock/jobs/342797313 [ci skip] The full commit message that triggered this build is copied below: autobuild.sh: include webpage.py execution (#113) Most autobuild users will want to automatically update the webpage. See discussion at #101 (comment) Update README to better document autobuild.
Most autobuild users will want to automatically update the webpage. See discussion at manubot/rootstock#101 (comment) Update README to better document autobuild.
Most autobuild users will want to automatically update the webpage. See discussion at manubot/rootstock#101 (comment) Update README to better document autobuild.
Work in progress
Closes #96