From: Mark Hansen Date: Tue, 2 Jun 2020 11:06:37 +0000 (+1000) Subject: Inline shapes.3 into shapes.html.j2 X-Git-Tag: 2.44.1~28^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abb4b6940bd6212398600dc00a327de16db1c929;p=graphviz Inline shapes.3 into shapes.html.j2 Now shapes.html.j2 is a complete template for the shapes.html page. --- diff --git a/doc/infosrc/Makefile b/doc/infosrc/Makefile index f95af5b1b..8ad0c3330 100644 --- a/doc/infosrc/Makefile +++ b/doc/infosrc/Makefile @@ -156,10 +156,8 @@ shapes : shapelist mkshapes.sh ./mkshapes.sh touch shapes -shapes.html : shapes mkshhtml.py html.html shapes.3 record.gif record2.gif sdlshapes.png templates/shapes.html.j2 - ./mkshhtml.py < shapelist > shapes.html - cat html.html >> shapes.html - cat shapes.3 >> shapes.html +shapes.html : shapes mkshhtml.py html.html record.gif record2.gif sdlshapes.png templates/shapes.html.j2 shapelist + ./mkshhtml.py html.html < shapelist > shapes.html lang.html : grammar lang.1 lang.2 mklang ./mklang grammar gramtmp diff --git a/doc/infosrc/mkshhtml.py b/doc/infosrc/mkshhtml.py index 57f227534..7314bd8d3 100755 --- a/doc/infosrc/mkshhtml.py +++ b/doc/infosrc/mkshhtml.py @@ -1,18 +1,15 @@ #!/usr/bin/env python3 +# Generates shapes.html. Takes path to an html.html file to include as argv[1], +# and a shapelist on stdin. -from dataclasses import dataclass import jinja2 import markupsafe -import re import sys -from typing import List, Dict +from typing import List -N_PER_ROW=4 +N_PER_ROW = 4 -shapes = [] -for line in sys.stdin: - shape = line.strip() - shapes.append(shape) +shapes = [line.strip() for line in sys.stdin] # From https://stackoverflow.com/a/312464/171898 def chunks(lst, n): @@ -35,4 +32,7 @@ env = jinja2.Environment( undefined=jinja2.StrictUndefined, ) template = env.get_template('shapes.html.j2') -print(template.render(rows=chunks(shapes, N_PER_ROW))) +print(template.render( + html=markupsafe.Markup(open(sys.argv[1]).read()), + rows=chunks(shapes, N_PER_ROW), +)) diff --git a/doc/infosrc/shapes.3 b/doc/infosrc/shapes.3 deleted file mode 100644 index d9636d2f4..000000000 --- a/doc/infosrc/shapes.3 +++ /dev/null @@ -1,28 +0,0 @@ -

User-defined Nodes

- -There is a third type of node shape which is specified by the user. -Typically, these shapes rely on the details of a concrete graphics -format. At present, shapes can be described using PostScript, via a -file or add-on library, for use in PostScript output, or shapes can -be specified by a bitmap-image file for use with SVG or bitmap (jpeg, -gif, etc.) output. More information can be found on the page - -How to create custom shapes. - -

SDL Shapes for PostScript

-One example of user-defined node shapes is provided by Mark Rison of CSR. -These are the SDL shapes. -These are available as PostScript functions whose use is described in - External PostScript procedures. -The necessary PostScript library file and sample use can be found in the -contrib/sdlshapes directory in the release. Please note the -COPYRIGHT AND PERMISSION NOTICE contained in the library file sdl.ps. -

-The table below -gives the shape names and the corresponding node shapes. -

-

- -
- - diff --git a/doc/infosrc/templates/shapes.html.j2 b/doc/infosrc/templates/shapes.html.j2 index fbdd1016a..0e3d3d44d 100644 --- a/doc/infosrc/templates/shapes.html.j2 +++ b/doc/infosrc/templates/shapes.html.j2 @@ -278,3 +278,32 @@ See also penwidth.

Additional styles may be available with a specific code generator. +{{ html -}} +

User-defined Nodes

+ +There is a third type of node shape which is specified by the user. +Typically, these shapes rely on the details of a concrete graphics +format. At present, shapes can be described using PostScript, via a +file or add-on library, for use in PostScript output, or shapes can +be specified by a bitmap-image file for use with SVG or bitmap (jpeg, +gif, etc.) output. More information can be found on the page + +How to create custom shapes. + +

SDL Shapes for PostScript

+One example of user-defined node shapes is provided by Mark Rison of CSR. +These are the SDL shapes. +These are available as PostScript functions whose use is described in + External PostScript procedures. +The necessary PostScript library file and sample use can be found in the +contrib/sdlshapes directory in the release. Please note the +COPYRIGHT AND PERMISSION NOTICE contained in the library file sdl.ps. +

+The table below +gives the shape names and the corresponding node shapes. +

+

+ +
+ +