Add local codes/ folder for MCS tutorials, replace upstream links with downloads - #138
Open
marcusr2ML wants to merge 4 commits into
Open
Add local codes/ folder for MCS tutorials, replace upstream links with downloads#138marcusr2ML wants to merge 4 commits into
marcusr2ML wants to merge 4 commits into
Conversation
The parameter-file and script links on the Monte Carlo tutorial pages pointed at github.com/ALPSim/ALPS blob URLs. The `download` attribute is ignored on cross-origin links, so clicking one navigated the reader off to GitHub rather than saving the file. Vendor the 46 linked files under content/en/tutorials/mcs/codes/, mirroring the layout already used by the ED tutorials, and repoint every link at ../codes/<tutorial>/<file>. Same-origin links honour `download`, so readers now stay on the page. Files are copied verbatim from ALPSim/ALPS master. Several parameter files differ from the code blocks shown on the pages (parm2a, parm2b, parm3a, parm3b, parm4, parm6a, parm6d); reconciling those is left to a follow-up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Same change as the DMFT branch, in response to the review there: keeping copies of the tutorial scripts in the website repo means two copies that inevitably drift apart. Drop the 46 vendored files under content/en/tutorials/mcs/codes/ and point the links back at ALPSim/ALPS. To keep the reader on the page -- the reason the copies were vendored -- add a click handler that fetches the raw file and saves it via a blob URL. The HTML download attribute is ignored cross-origin, but raw.githubusercontent.com sends access-control-allow-origin: *, so the fetch is permitted and the blob counts as same-origin for the purposes of download. The links are pinned to daa7392 rather than tracking master, matching the DMFT branch: the pages reproduce each file inline, so tracking master would let the displayed text and the downloaded file diverge silently. All 46 paths were confirmed to resolve at that commit. The handler and its baseof.html wiring are byte-identical to the copies on feat/dmft-local-downloads, so the two branches merge cleanly in either order. Whichever lands second contributes only its content changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Point the MCS downloads at the master branch of ALPSim/ALPS instead of pinning them to commit daa7392, so the tutorials serve the current source rather than a snapshot that silently goes stale. Bring the Japanese and Chinese MCS pages in line with the English ones. They still used `<a href=".../blob/master/..." download>`, which does not download: the `download` attribute is ignored cross-origin, and a blob/ URL serves GitHub's HTML page rather than the file, so those links navigated the reader away from the tutorial. They now use the same alps-download anchors against raw.githubusercontent.com. Note: en mc08 has two links (parm8c, tutorial8c.py) with no counterpart in the translations, which predates this change and is left alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The link sat on the words "downloadable file" while the filename it saves, `parm1a`, sat unlinked right after it. Move the anchor onto `parm1a` so the clickable text names the file the reader gets. This was the only download link in the MCS series whose text was not the filename; all 46 now match. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follows the same pattern as #132 (DMRG) and the existing ED tutorials.
Simple test the links work.
Note some of the parameter files are inconsistent with the text (falgged below). I will fix these on a separate PR.
(CLAUDE)
Problem
Every parameter-file and script link on the Monte Carlo tutorial pages pointed at
github.com/ALPSim/ALPS/blob/master/...and carried adownloadattribute:The
downloadattribute is ignored on cross-origin links, so it never had any effect — clicking one navigated the reader off to GitHub instead of saving the file. Readers left the site to get a two-line parameter file.Change
content/en/tutorials/mcs/codes/<tutorial>/, mirroring the layout already used by the ED tutorials.../codes/<tutorial>/<file>. Same-origin links honourdownload, so the file now saves and the reader stays on the page.Nine pages touched:
mc01a,mc01b,mc02–mc08. No prose, parameters, or figures were changed — this is a link-plumbing change only.Verification
hugo --gc --minifybuilds clean; all 46 files publish topublic/tutorials/mcs/codes/.hugo server.github.com/ALPSim/ALPS/bloblinks remain anywhere undercontent/en/tutorials/mcs/.Known follow-up
The vendored files are copied verbatim from
ALPSim/ALPSmaster. Seven of them differ from the code blocks printed on the pages —parm2a,parm2b,parm3a,parm3b,parm4,parm6a,parm6d— mostly inSWEEPS/THERMALIZATION(statistics only, no effect on the plotted curves), butparm3bdiffers in its field grid andparm6aomitsT_MIN/T_MAX/DELTA_Tthat the command-line workflow needs. Reconciling page text against these files is left to a separate PR, since it needs a physics call rather than a text edit.🤖 Generated with Claude Code