Skip to content

Commit

Permalink
views doc setup and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heckj committed Aug 6, 2022
1 parent a685885 commit 45c8cb9
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 37 deletions.
8 changes: 4 additions & 4 deletions Sources/Lindenmayer/LSystem.swift
Expand Up @@ -28,13 +28,13 @@ import Foundation
///
/// ### Creating a Contextual L-system with Randomness
///
/// - ``LSystem/create(_:with:)-8xbbx``
/// - ``LSystem/create(_:with:)-1otrb``
/// - ``Lindenmayer/LSystem/create(_:with:)-5qbah``
/// - ``Lindenmayer/LSystem/create(_:with:)-9349q``
///
/// ### Creating a Contextual L-system with Randomness and Parameters
///
/// - ``LSystem/create(_:with:using:)-49uk9``
/// - ``LSystem/create(_:with:using:)-49uk9``
/// - ``Lindenmayer/LSystem/create(_:with:using:)-1nce9``
/// - ``Lindenmayer/LSystem/create(_:with:using:)-2nwqc``
///
public enum LSystem {
/// Creates a new Lindenmayer system from an initial state.
Expand Down
7 changes: 6 additions & 1 deletion Sources/Lindenmayer/Lindenmayer.docc/Lindenmayer.md
Expand Up @@ -28,7 +28,6 @@ To get support for using this package, see the [Discussions on Github](https://g
- ``ParameterizedRandomContextualLSystem``
- ``LindenmayerSystem``
- ``ModuleSet``
- ``RNGWrapper``
- ``ParametersWrapper``

### Modules
Expand Down Expand Up @@ -85,3 +84,9 @@ To get support for using this package, see the [Discussions on Github](https://g

- ``Examples2D``
- ``Examples3D``

### Seeded Pseudo-Random Number Generation

- ``RNGWrapper``
- ``Lindenmayer/SeededRandomNumberGenerator``
- ``Lindenmayer/Xoshiro``
Expand Up @@ -112,7 +112,7 @@ public struct ParameterizedRandomContextualLSystem<PType, PRNG>: LindenmayerSyst
/// - prng: A psuedo-random number generator to use for stochastic rule productions.
/// - rules: A collection of rules that the Lindenmayer system applies when you call the evolve function.
///
/// Convenient initializers for creating contextual L-systems uses ``LSystem``, calling ``LSystem/create(_:with:using:)-30rc3``, or ``LSystem/create(_:with:using:)-49uk9``.
/// Convenient initializers for creating contextual L-systems uses ``LSystem``, calling ``Lindenmayer/LSystem/create(_:with:using:)-1nce9``, or ``Lindenmayer/LSystem/create(_:with:using:)-2nwqc``
public init(axiom: [Module],
state: [Module]?,
newStateIndicators: [Bool]?,
Expand Down
3 changes: 2 additions & 1 deletion Sources/Lindenmayer/RandomContextualLSystem.swift
Expand Up @@ -90,7 +90,8 @@ public struct RandomContextualLSystem<PRNG>: LindenmayerSystem where PRNG: Seede
/// - prng: A psuedo-random number generator to use for stochastic rule productions.
/// - rules: A collection of rules that the Lindenmayer system applies when you call the evolve function.
///
/// Convenient initializers for creating contextual L-systems uses ``LSystem``, calling ``LSystem/create(_:with:)-1otrb``, or ``LSystem/create(_:with:)-1otrb``.
/// Convenient initializers for creating contextual L-systems uses ``LSystem``,
/// calling ``Lindenmayer/LSystem/create(_:with:using:)-1nce9``, or ``Lindenmayer/LSystem/create(_:with:using:)-2nwqc``.
public init(axiom: [Module],
state: [Module]?,
newStateIndicators: [Bool]?,
Expand Down
Expand Up @@ -4,6 +4,36 @@ LindenmayerViews provides a collection of SwiftUI views to display the results 2

## Overview

## Topics

### Example Views

- ``LindenmayerViews/Monopodial4Examples``
- ``LindenmayerViews/Sympodial4Examples``

### 2D View Components

- ``LindenmayerViews/Lsystem2DView``
- ``LindenmayerViews/Dynamic2DLSystemViews``

### 3D View Components

- ``LindenmayerViews/Lsystem3DView``
- ``LindenmayerViews/LSystem3DControlView``
- ``LindenmayerViews/LSystem3DModel``

### General View Components

- ``LindenmayerViews/HorizontalLSystemStateView``
- ``LindenmayerViews/LSystemMetrics``
- ``LindenmayerViews/ModuleDetailView``
- ``LindenmayerViews/ModuleSummaryView``
- ``LindenmayerViews/EmptyModuleSummaryView``
- ``LindenmayerViews/StateSelectorView``
- ``LindenmayerViews/WindowedSmallModuleView``
- ``LindenmayerViews/SummarySizes``

### Debugging Views

- ``LindenmayerViews/RollToVerticalTestView``

## Topics
2 changes: 1 addition & 1 deletion docanalyze.bash
Expand Up @@ -22,7 +22,7 @@ xcrun docc convert Sources/Lindenmayer/Lindenmayer.docc \
--analyze \
--fallback-display-name Lindenmayer \
--fallback-bundle-identifier com.github.heckj.Lindenmayer \
--fallback-bundle-version 0.1.0 \
--fallback-bundle-version 0.7.2 \
--additional-symbol-graph-dir .build/symbol-graphs \
--experimental-documentation-coverage \
--level brief
78 changes: 50 additions & 28 deletions docbuild.bash
@@ -1,36 +1,58 @@
#!/bin/bash

set -e
set -x

rm -rf html
mkdir -p html

rm -rf .build
mkdir -p .build/symbol-graphs

# Lindenmayer.symbols.json LindenmayerViews.symbols.json SceneKitDebugTools@simd.symbols.json
# Lindenmayer@Swift.symbols.json SceneKitDebugTools.symbols.json Squirrel3.symbols.json
# Lindenmayer@simd.symbols.json SceneKitDebugTools@Swift.symbols.json

swift build --target Lindenmayer \
--target LindenmayerViews \
-Xswiftc -emit-symbol-graph \
-Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs

# cull the non-Lindenmayer specific builds from the symbol graph files
rm -f .build/symbol-graphs/SceneKitDebug* .build/symbol-graphs/Squirrel3*

echo "Make sure you've rebased over the current HEAD branch:"
echo "git rebase -i origin/main docs"

set -e # exit on a non-zero return code from a command
set -x # print a trace of commands as they execute

#rm -rf .build
#mkdir -p .build/symbol-graphs
#
#$(xcrun --find swift) build --target Lindenmayer --target LindenmayerViews \
# -Xswiftc -emit-symbol-graph \
# -Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs
#rm -f .build/symbol-graphs/SceneKitDebug* .build/symbol-graphs/Squirrel3*

# Enables deterministic output
# - useful when you're committing the results to host on github pages
export DOCC_JSON_PRETTYPRINT=YES

xcrun docc convert Sources/Lindenmayer/Lindenmayer.docc \
--enable-inherited-docs \
--output-path Lindenmayer.doccarchive \
--fallback-display-name Lindenmayer \
--fallback-bundle-identifier com.github.heckj.Lindenmayer \
--fallback-bundle-version 0.1.0 \
--additional-symbol-graph-dir .build/symbol-graphs
#xcrun docc convert Sources/Lindenmayer/Lindenmayer.docc \
#--enable-inherited-docs \
#--output-path Lindenmayer.doccarchive \
#--fallback-display-name Lindenmayer \
#--fallback-bundle-identifier com.github.heckj.Lindenmayer \
#--fallback-bundle-version 0.1.0 \
#--additional-symbol-graph-dir .build/symbol-graphs

#--transform-for-static-hosting \
#--hosting-base-path '/' \
#--emit-digest


# Swift package plugin for hosted content:
#
$(xcrun --find swift) package \
--allow-writing-to-directory ./docs \
generate-documentation \
--fallback-bundle-identifier com.github.heckj.Lindenmayer \
--fallback-bundle-version 0.7.2 \
--target Lindenmayer \
--target LindenmayerViews \
--output-path ./docs \
--emit-digest \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path 'Lindenmayer'

# Generate a list of all the identifiers to assist in DocC curation
#

cat docs/linkable-entities.json | jq '.[].referenceURL' -r > all_identifiers.txt
sort all_identifiers.txt \
| sed -e 's/doc:\/\/com\.github\.heckj\.Lindenmayer\/documentation\///g' \
| sed -e 's/^/- ``/g' \
| sed -e 's/$/``/g' > all_symbols.txt

echo "Page will be available at https://swiftviz.github.io/Lindenmayer/documentation/Lindenmayer/"

0 comments on commit 45c8cb9

Please sign in to comment.