Skip to content

Commit

Permalink
new: --hide_annotations command line option
Browse files Browse the repository at this point in the history
  • Loading branch information
laowantong committed Oct 10, 2015
1 parent e36bfec commit dfe48e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion doc/fr_refman.html
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,9 @@ <h3 id="3.2.2.-Liste-des-arguments-">3.2.2. Liste des arguments <a id="parametra
<li><a href="#introduction"><strong><code>--shapes PATH</code></strong></a>.<br>
Spécification des polices, des dimensions, etc. Nom (sans extension) d'un fichier du répertoire <code>shapes</code>, ou chemin vers un fichier personnel (défaut: dépendant de votre système).</li>
<li><a href="#introduction"><strong><code>--scale SCALE</code></strong></a>.<br>
facteur d'échelle multiplicatif (défaut: <code>1.0</code>).</li>
Facteur d'échelle multiplicatif (défaut: <code>1.0</code>).</li>
<li><strong><code>--hide_annotations</code></strong>.<br>
Ignore le survol des éléments annotés (défaut: <code>False</code>).</li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -3649,6 +3651,7 @@ <h3 id="4.3.2.-Afficher-l'explication-des-cardinalit&#233;s-">4.3.2. Afficher l'
<div class="text_cell_render border-box-sizing rendered_html">
<p>Les annotations s'insèrent entre cardinalités et nom de l'entité. Elles sont délimitées par des crochets droits.</p>
<p>Avec l'option <code>--disambiguation=annotations</code> (par défaut), elles sont également exploitables lors du passage au relationnel pour <a href="#retablissement_semantique_df">préciser la sémantique d'une clef étrangère</a>.</p>
<p>L'affichage est désactivé avec l'option <code>--hide_annotations</code>.</p>
<p><strong>Limitations.</strong></p>
<ul>
<li>Ne fonctionne pas sous Inkscape.</li>
Expand Down
6 changes: 5 additions & 1 deletion doc/fr_refman.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,9 @@
" - [**`--shapes PATH`**](#introduction). \n",
" Spécification des polices, des dimensions, etc. Nom (sans extension) d'un fichier du répertoire `shapes`, ou chemin vers un fichier personnel (défaut: dépendant de votre système).\n",
" - [**`--scale SCALE`**](#introduction). \n",
" facteur d'échelle multiplicatif (défaut: `1.0`)."
" Facteur d'échelle multiplicatif (défaut: `1.0`).\n",
" - **`--hide_annotations`**. \n",
" Ignore le survol des éléments annotés (défaut: `False`)."
],
"cell_type": "markdown",
"metadata": {}
Expand Down Expand Up @@ -3090,6 +3092,8 @@
"\n",
"Avec l'option `--disambiguation=annotations` (par défaut), elles sont également exploitables lors du passage au relationnel pour [préciser la sémantique d'une clef étrangère](#retablissement_semantique_df).\n",
"\n",
"L'affichage est désactivé avec l'option `--hide_annotations`.\n",
"\n",
"**Limitations.**\n",
"\n",
"- Ne fonctionne pas sous Inkscape.\n",
Expand Down
1 change: 1 addition & 0 deletions mocodo/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def add_key(key, value):
aspect_group.add_argument("--colors", metavar="PATH", default="bw", help="the color palette to use when generating the drawing. Name (without extension) of a file located in the directory 'colors', or path to a personal file")
aspect_group.add_argument("--shapes", metavar="PATH", help="specification of the fonts, dimensions, etc. Name (without extension) of a file located in the directory 'shapes', or path to a personal file")
aspect_group.add_argument("--scale", metavar="RATE", type=scale, default=1.0, help="scale the diagram by the given factor")
aspect_group.add_argument("--hide_annotations", action="store_true", help="ignore the hovering of annotated elements")

relational_group.add_argument("--relations", metavar="NAME", nargs="*", default=["html", "text"], help="one or several templates for the generated relational schemas. Cf. directory 'relation_templates'")
relational_group.add_argument("--disambiguation", choices=["numbers_only", "annotations"], default="annotations", help="specify the way to disambiguate foreign attributes")
Expand Down
2 changes: 1 addition & 1 deletion mocodo/mcd_to_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def main(mcd, common):
tabs = tabs + (1 if d["key"] == "begin" else 0)
else:
result.append("\nlines += u\"\"\"\\n\\n<!-- %s -->\"\"\"" % d)
if has_annotated_card:
if has_annotated_card and not params["hide_annotations"]:
salt = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(8)) # prevent the same identifiers to appear in several figures of the same notebook
result.append("""annotation_overlay_height = %(annotation_overlay_height)s\nannotation_baseline = %(annotation_baseline)s\nannotation_font = %(annotation_font)s\nannotation_text_color = "%(annotation_text_color)s"\nannotation_color = "%(annotation_color)s"\nannotation_opacity = %(annotation_opacity)s\n""" % style)
result.append("""lines += '\\n\\n<!-- Annotations -->'""")
Expand Down

0 comments on commit dfe48e5

Please sign in to comment.