Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

66%
+2 −0
Q&A How can I highlight changes in HTML output from Flare, based on branch diff?

We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach. Flare versions from 2016 onward support...

posted 4y ago by Monica Cellio‭  ·  edited 3y ago by Monica Cellio‭

Answer
#5: Post edited by user avatar Monica Cellio‭ · 2020-10-18T21:12:49Z (over 3 years ago)
we've made some improvements since my last update
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named *original-title*-diff.html. The script modifies the original file (*original-title*.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named *original-title*-diff.html. The script modifies the original file (*original-title*.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • The script also generates a list of links to pages with changes, each with links to the git commits that made them, and inserts it into the build. This gives us a place to record *new* topics, which have nothing to diff against.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. Our script doesn't report deleted files, though I don't see why it couldn't (it hasn't come up). But a 90% solution is still a big improvement for us, and people who want that last 10% and don't mind reading XML source can follow the links to the git diff directly.
#4: Post edited by user avatar Monica Cellio‭ · 2020-01-10T02:20:37Z (about 4 years ago)
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named original_title_diff.html. The script modifies the original file (original_title.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named *original-title*-diff.html. The script modifies the original file (*original-title*.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
#3: Post edited by user avatar Monica Cellio‭ · 2020-01-10T02:19:55Z (about 4 years ago)
can't make the markdown play well with the underscores in the name, so just removed it
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named *original_title*__diff.html. The script modifies the original file (*original_title*.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named original_title_diff.html. The script modifies the original file (original_title.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
#2: Post edited by user avatar Monica Cellio‭ · 2020-01-10T02:19:13Z (about 4 years ago)
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named *original_title*_diff.html. The script modifies the original file (*original_title*.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
  • We did not find an off-the-shelf solution to this and built our own. I'm not the author and can't release the code, but here is an overview of the approach.
  • Flare versions from 2016 onward support adding pre- and post-build steps to a build target. We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step. This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.
  • The script uses the `git` package to identify files that have been added, deleted, or changed. For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file. (We use the pink and green highlighting familiar to git users.) This is a file that shows the full diff and in the output is named *original_title*__diff.html. The script modifies the original file (*original_title*.xml, in this example) to insert a prominent link to the diff page. This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.
  • This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right. But a 90% solution is still a big improvement for us.
#1: Initial revision by user avatar Monica Cellio‭ · 2020-01-09T19:26:08Z (about 4 years ago)
We did not find an off-the-shelf solution to this and built our own.  I'm not the author and can't release the code, but here is an overview of the approach.

Flare versions from 2016 onward support adding pre- and post-build steps to a build target.  We modified our "branch build" target to call our "get-diffs" Python script as a pre-build step.  This script modifies the locally-checked-out XML source for our doc, which Flare then builds in the main build phase.

The script uses the `git` package to identify files that have been added, deleted, or changed.  For changed files that exist on master and on the branch, the script does its own diff and inserts formatting to show it into a new XML file.  (We use the pink and green highlighting familiar to git users.)  This is a file that shows the full diff and in the output is named *original_title*_diff.html.  The script modifies the original file (*original_title*.xml, in this example) to insert a prominent link to the diff page.  This allows reviewers to read the topic "as it is" while also being able to inspect a diff; we found this less invasive and more likely to produce useful review feedback than just giving people the doc with inline diffs.

This approach is not bulletproof; changes to structure, like moving things around in the table of contents, do not show up, and diffs in snippets don't seem to work right.  But a 90% solution is still a big improvement for us.