Skip to content

Commit

Permalink
export/html: DIFF: add a legend to explain the most basic query rules
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislaw committed Dec 22, 2023
1 parent 63fd784 commit d85e77d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions strictdoc/export/html/templates/screens/git/legend.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div>
<h5>Legend</h5>
<p>The Diff/Changelog feature only works when StrictDoc is run against a directory which is a Git repository.</p>
<p>The left-hand-side (LHS) and the right-hand-side (RHS) revisions must be valid Git revisions.</p>
<p>Examples of valid revisions: a Git branch or a Git commit. Examples: `main`, `origin/main`, `63fd784`.
<p>The StrictDoc's custom revision `HEAD+` can be used to indicate "the current branch + all uncommitted changes".</p>
<p>The Diff/Changelog query is shareable via a URL. Example: <a href="http://127.0.0.1:5111/diff?left_revision=HEAD%5E&right_revision=HEAD&tab=diff">This link</a> opens a diff between the last commit and the last but one commit.</p>

<p>The StrictDoc diff algorithm compares documentation trees (left-hand side, LHS, and right-hand side, RHS) based on these principles:</p>

<ul>
<li>
Optimal comparison of document contents is achieved using automatically-generated Machine Identifiers (MID). This ensures the best match.
</li>
<li>
If document nodes, such as Sections or Requirements, lack MIDs, they are matched using their UID field. Matching quality with UIDs is comparable to that with MIDs, provided all nodes have UIDs.
</li>
<li>
In cases where document nodes do not have either MID or UID, matching generally isn't performed or is very limited to the most basic cases. Changes to nodes lacking MID/UID are recorded as separate events: "node removed" for LHS and "node added" for RHS.
</li>
</ul>
</div>
2 changes: 2 additions & 0 deletions strictdoc/export/html/templates/screens/git/main.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<turbo-frame id="diff_result" src="/diff_result?tab={{ tab }}&left_revision={{ left_revision_urlencoded }}&right_revision={{ right_revision_urlencoded }}">
{% include "screens/git/skeleton.jinja" %}
</turbo-frame>
{% else %}
{% include "screens/git/legend.jinja" %}
{% endif %}
{% else %}
{% include "screens/git/frame_"~tab~"_result.jinja" %}
Expand Down

0 comments on commit d85e77d

Please sign in to comment.