mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Tweak docs gen to allow a lone period on a line to break a paragraph.
This commit is contained in:
parent
86e4e3d892
commit
719a80c5d0
3 changed files with 30 additions and 16 deletions
|
@ -19,8 +19,8 @@ LibFile blocks can be followed by multiple lines that can be added as markdown t
|
||||||
// You just need to make sure that each line is indented, with
|
// You just need to make sure that each line is indented, with
|
||||||
// at least three spaces after the comment marker. You can
|
// at least three spaces after the comment marker. You can
|
||||||
// denote a paragraph break with a comment line with three
|
// denote a paragraph break with a comment line with three
|
||||||
// trailing spaces.
|
// trailing spaces, or just a period.
|
||||||
//
|
// .
|
||||||
// The end of the block is denoted by a line without a comment.
|
// The end of the block is denoted by a line without a comment.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -33,12 +33,12 @@ Sections can also include Figures; images generated from code that is not shown
|
||||||
```
|
```
|
||||||
// Section: Foobar
|
// Section: Foobar
|
||||||
// You can have several lines of markdown formatted text here.
|
// You can have several lines of markdown formatted text here.
|
||||||
// You just need to make sure that each line is indented with
|
// You just need to make sure that each line is indented, with
|
||||||
// at least three spaces after the comment marker. You can
|
// at least three spaces after the comment marker. You can
|
||||||
// denote a paragraph break with a comment line with three
|
// denote a paragraph break with a comment line with three
|
||||||
// trailing spaces.
|
// trailing spaces, or just a period.
|
||||||
//
|
// .
|
||||||
// The end of the block is denoted by a line without a comment,
|
// The end of the block is denoted by a line without a comment.
|
||||||
// or a line that is unindented after the comment.
|
// or a line that is unindented after the comment.
|
||||||
// Figure: Figure description
|
// Figure: Figure description
|
||||||
// cylinder(h=100, d1=75, d2=50);
|
// cylinder(h=100, d1=75, d2=50);
|
||||||
|
@ -70,25 +70,28 @@ Valid sub-blocks are:
|
||||||
- `Status: DEPRECATED, use blah instead.` - Optional, used to denote deprecation.
|
- `Status: DEPRECATED, use blah instead.` - Optional, used to denote deprecation.
|
||||||
- `Usage: Optional Usage Title` - Optional. Multiple allowed. Followed by an indented block of usage patterns. Optional arguments should be in braces like `[opt]`. Alternate args should be separated by a vertical bar like `r|d`.
|
- `Usage: Optional Usage Title` - Optional. Multiple allowed. Followed by an indented block of usage patterns. Optional arguments should be in braces like `[opt]`. Alternate args should be separated by a vertical bar like `r|d`.
|
||||||
- `Description:` - Can be single-line or a multi-line block of the description.
|
- `Description:` - Can be single-line or a multi-line block of the description.
|
||||||
|
- `Figure: Optional Figure Title` - Optional. Multiple allowed. Followed by a multi-line code block used to create a figure image. The code will not be shown. All figures will follow the Description block.
|
||||||
- `Arguments:` - Denotes start of an indented block of argument descriptions. Each line has the argument name, a space, an equals, another space, then the description for the argument all on one line. Like `arg = The argument description`. If you really need to explain an argument in longer form, explain it in the Description.
|
- `Arguments:` - Denotes start of an indented block of argument descriptions. Each line has the argument name, a space, an equals, another space, then the description for the argument all on one line. Like `arg = The argument description`. If you really need to explain an argument in longer form, explain it in the Description.
|
||||||
- `Side Effects:` - Denotes the start of a block describing the side effects, such as `$special_var`s that are set.
|
- `Side Effects:` - Denotes the start of a block describing the side effects, such as `$special_var`s that are set.
|
||||||
- `Extra Anchors:` - Denotes the start of an indented block of available non-standard named anchors for a part.
|
- `Extra Anchors:` - Denotes the start of an indented block of available non-standard named anchors for a part.
|
||||||
- `Example:` - Denotes the beginning of a multi-line example code block.
|
- `Example:` - Denotes the beginning of a multi-line example code block.
|
||||||
- `Examples:` - Denotes the beginning of a block of examples, where each line will be shows as a separate example with a separate image if needed.
|
- `Examples:` - Denotes the beginning of a block of examples, where each line will be shows as a separate example with a separate image if needed.
|
||||||
|
|
||||||
Modules blocks will generate images for each example block. Function and Constant blocks will only generate images for example blocks if they have `2D` or `3D` tags. Example blocks can have tags added by putting then inside parentheses before the colon. Ie: `Examples(BigFlatSpin):`.
|
Modules blocks will generate images for each example or figure block. Function and Constant blocks will only generate images for example blocks if they have `2D` or `3D` tags. Example and figure blocks can have tags added by putting then inside parentheses before the colon. Ie: `Examples(BigFlatSpin):` or `Figure(2D):`.
|
||||||
|
|
||||||
The full set of optional example tags are:
|
The full set of optional example tags are:
|
||||||
|
|
||||||
- `2D`: Orient camera in a top-down view for showing 2D objects.
|
- `2D`: Orient camera in a top-down view for showing 2D objects.
|
||||||
- `3D`: Orient camera in an oblique view for showing 3D objects. Used to force an Example sub-block to generate an image in Function and Constant blocks.
|
- `3D`: Orient camera in an oblique view for showing 3D objects. Used to force an Example sub-block to generate an image in Function and Constant blocks.
|
||||||
- `Spin`: Animate camera orbit around the `[0,1,1]` axis to display all sides of an object.
|
- `NORENDER`: Don't generate an image for this example.
|
||||||
- `FlatSpin`: Animate camera orbit around the Z axis, above the XY plane.
|
|
||||||
- `Edges`: Highlight face edges.
|
|
||||||
- `FR`: Force full rendering from OpenSCAD, instead of the normal preview.
|
|
||||||
- `Small`: Make the image small sized. (The default)
|
- `Small`: Make the image small sized. (The default)
|
||||||
- `Med`: Make the image medium sized.
|
- `Med`: Make the image medium sized.
|
||||||
- `Big`: Make the image big sized.
|
- `Big`: Make the image big sized.
|
||||||
|
- `Huge`: Make the image huge sized.
|
||||||
|
- `Spin`: Animate camera orbit around the `[0,1,1]` axis to display all sides of an object.
|
||||||
|
- `FlatSpin`: Animate camera orbit around the Z axis, above the XY plane.
|
||||||
|
- `FR`: Force full rendering from OpenSCAD, instead of the normal preview.
|
||||||
|
- `Edges`: Highlight face edges.
|
||||||
|
|
||||||
Indentation is important, as it denotes the end of sub-block.
|
Indentation is important, as it denotes the end of sub-block.
|
||||||
|
|
||||||
|
@ -105,12 +108,19 @@ Indentation is important, as it denotes the end of sub-block.
|
||||||
// A longer, multi-line description.
|
// A longer, multi-line description.
|
||||||
// All description blocks are added together.
|
// All description blocks are added together.
|
||||||
// You _can_ use *markdown* notation as well.
|
// You _can_ use *markdown* notation as well.
|
||||||
// You can have paragraph breaks by having a blank line with
|
// You can have paragraph breaks by having a
|
||||||
// only enough trailing spaces to match indentation like this:
|
// line with just a period, like this:
|
||||||
//
|
// .
|
||||||
// You can end multi-line blocks by un-indenting the next
|
// You can end multi-line blocks by un-indenting the next
|
||||||
// line, or by using a comment with no spaces like this:
|
// line, or by using a comment with no spaces like this:
|
||||||
//
|
//
|
||||||
|
// Figure: Figure description
|
||||||
|
// cylinder(h=100, d1=75, d2=50);
|
||||||
|
// up(100) cylinder(h=100, d1=50, d2=75);
|
||||||
|
// Figure(Spin): Animated figure that spins to show all faces.
|
||||||
|
// cube([10,100,50], center=true);
|
||||||
|
// cube([100,10,30], center=true);
|
||||||
|
//
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// foo = This is the description of the foo argument. All on one line.
|
// foo = This is the description of the foo argument. All on one line.
|
||||||
// bar = This is the description of the bar argument. All on one line.
|
// bar = This is the description of the bar argument. All on one line.
|
||||||
|
|
|
@ -82,6 +82,8 @@ def get_comment_block(lines, prefix, blanks=1):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
blankcnt = 0
|
blankcnt = 0
|
||||||
|
if line == ".":
|
||||||
|
line == ""
|
||||||
out.append(line.rstrip())
|
out.append(line.rstrip())
|
||||||
return (lines, out)
|
return (lines, out)
|
||||||
|
|
||||||
|
@ -233,7 +235,9 @@ class ImageProcessing(object):
|
||||||
with open(scriptfile, "w") as f:
|
with open(scriptfile, "w") as f:
|
||||||
f.write(script)
|
f.write(script)
|
||||||
|
|
||||||
if "Big" in extype:
|
if "Huge" in extype:
|
||||||
|
imgsize = (800, 600)
|
||||||
|
elif "Big" in extype:
|
||||||
imgsize = (640, 480)
|
imgsize = (640, 480)
|
||||||
elif "Med" in extype or "distribute" in script or "show_anchors" in script:
|
elif "Med" in extype or "distribute" in script or "show_anchors" in script:
|
||||||
imgsize = (480, 360)
|
imgsize = (480, 360)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,320];
|
BOSL_VERSION = [2,0,321];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue