Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Improvements #476

Merged
merged 30 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a5a8c81
Fix possible OOB debug assert
guusw Nov 29, 2022
fe57fcd
Update doc format
guusw Dec 6, 2022
f917f92
Improve search functionality
guusw Dec 6, 2022
83c4301
Generate docs & help strings for enums
guusw Dec 5, 2022
31a36b1
Move introduction & add shards meta doc
guusw Dec 1, 2022
4044465
Link types and shards meta doc page. Unify naming
guusw Dec 1, 2022
3574a72
Fix header
guusw Dec 5, 2022
d6dd6c8
Move docs => reference
guusw Dec 5, 2022
720261b
Add render sample & output
guusw Dec 5, 2022
fc55be4
Run GFX doc samples
guusw Dec 5, 2022
b9f84b9
Fix including log & rename log md
guusw Dec 5, 2022
e76e863
Remove verbose logging
guusw Dec 5, 2022
a6a9bbb
Apply suggestions from code review
guusw Dec 6, 2022
055ec58
Feedback fixes
guusw Dec 6, 2022
17dae04
Update docs/docs/reference/shards/types.md
guusw Dec 6, 2022
6589010
Fix separation of code samples
guusw Dec 6, 2022
c950dce
Update strings
guusw Dec 6, 2022
128530f
Fix test
guusw Dec 6, 2022
683d910
Fix drawable parameters
guusw Dec 6, 2022
3db39de
Fix test find statement
guusw Dec 6, 2022
d3b4444
Merge shard info test
guusw Dec 7, 2022
a3df376
Move doc generation script
guusw Dec 6, 2022
7293b6d
Fix base path
guusw Dec 6, 2022
67587cf
Clean up rust arguments
guusw Dec 7, 2022
7e34a38
Set CMAKE_NINJA_FORCE_RESPONSE_FILE on windows
guusw Dec 7, 2022
c46dc87
Add USE_LLD option
guusw Dec 7, 2022
205a75c
Add friendly enum formatting
guusw Dec 7, 2022
34481ba
Attempt to fix doc CI paths
guusw Dec 7, 2022
b1af54d
Always include log, only make .out.md optional
guusw Dec 7, 2022
960da23
Don't use lld on window CI step
guusw Dec 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/build-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@ jobs:
- name: Generate markdown
shell: msys2 {0}
run: |
./shards.exe src/tests/infos-docs.edn
mv docs/docs/docs/shards/General/UI.md docs/docs/docs/shards/UI/index.md
./shards.exe docs/generate.edn
- name: Upload markdown
uses: actions/upload-artifact@v3
with:
name: docs-markdown
path: |
docs/docs/docs/shards/**/*.md
!docs/docs/docs/shards/index.md
!docs/docs/docs/shards/types.md
docs/docs/reference/shards/**/*.md
docs/docs/reference/enums/**/*.md
!docs/docs/reference/enums/index.md
!docs/docs/reference/shards/index.md
!docs/docs/reference/shards/types.md
if-no-files-found: error

#
Expand Down Expand Up @@ -124,7 +125,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: docs-markdown
path: shards/docs/docs/docs/shards
path: shards/docs/docs/reference
- name: Download samples logs
uses: actions/download-artifact@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,21 @@ jobs:
./shards ../src/tests/edn.edn
./shards ../src/tests/pure.edn
./shards ../src/tests/shell.clj
./shards ../src/tests/infos.clj
- name: Test (Debug)
# Test that only works in Debug build go there
if: ${{ steps.setup.outputs.build-type == 'Debug' }}
env:
RUST_BACKTRACE: 1
run: |
cd build
./shards ../src/tests/shards.clj
./shards ../src/tests/export-strings.edn
- name: Test doc samples (non-UI)
env:
RUST_BACKTRACE: 1
run: |
cd docs/samples
for i in $(find shards -name '*.edn' ! -path '*UI*');
for i in $(find shards -name '*.edn' \( ! -path '*UI*' ! -path '*GFX*' \));
do
echo "Running sample $i";
../../build/shards run-sample.edn --file "$i";
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
RUST_BACKTRACE: 1
run: |
cd docs/samples
for i in $(find shards -name '*.edn' ! -path '*UI*');
for i in $(find shards -name '*.edn' \( ! -path '*UI*' ! -path '*GFX*' \));
do
echo "Running sample $i";
../../build/shards run-sample.edn --file "$i";
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ jobs:
./bootstrap
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ steps.setup.outputs.build-type }} -DUSE_LIBBACKTRACE=${{ steps.setup.outputs.bitness == '64bits' }} ..
# Some commits hang the linking step during one of the following targets
# Passing -DUSE_LLD=OFF will use the default mingw ld linker which doesn't have this issue
cmake -G Ninja -DUSE_LLD=OFF -DCMAKE_BUILD_TYPE=${{ steps.setup.outputs.build-type }} -DUSE_LIBBACKTRACE=${{ steps.setup.outputs.bitness == '64bits' }} ..
ninja ${{ steps.setup.outputs.build-target }}
- name: Test runtime (Debug)
if: ${{ steps.setup.outputs.runtime-tests == 'true' && steps.setup.outputs.build-type == 'Debug' }}
Expand Down Expand Up @@ -323,12 +325,12 @@ jobs:
shell: msys2 {0}
run: |
cd docs/samples
for i in $(find shards -name '*.edn' ! -path '*UI*');
for i in $(find shards -name '*.edn' \( ! -path '*UI*' ! -path '*GFX*' \));
do
echo "Running sample $i";
../../build/shards.exe run-sample.edn --file "$i";
done
- name: Test doc samples (UI)
- name: Test doc samples (GFX)
# NOTE: Graphics backend doesn't run on 32bits
if: ${{ steps.setup.outputs.bitness == '64bits' }}
env:
Expand All @@ -337,7 +339,7 @@ jobs:
shell: msys2 {0}
run: |
cd docs/samples
for i in $(find shards -name '*.edn' -path '*UI*');
for i in $(find shards -name '*.edn' \( -path '*UI*' -or -path '*GFX*' \));
do
echo "Running sample $i";
../../build/shards.exe run-sample.edn --file "$i";
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-linux-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:

echo "Running onnx test"
build/shards src/tests/onnx.edn
- name: Test doc samples (UI)
- name: Test doc samples (GFX)
env:
RUST_BACKTRACE: 1
run: |
Expand All @@ -110,7 +110,7 @@ jobs:
Xvfb "$DISPLAY" &

cd docs/samples
for i in $(find shards -name '*.edn' -path '*UI*');
for i in $(find shards -name '*.edn' \( -path '*UI*' -or -path '*GFX*'\));
do
echo "Running sample $i";
../../build/shards run-sample.edn --file "$i";
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ src/tests/example-dwt.wav
src/tests/example.wav.png
src/tests/svgtest.png
src/tests/mobilenetv2-7.onnx
/docs/docs/docs/shards/**/*.md
/docs/docs/reference/shards/**/*.md
11 changes: 10 additions & 1 deletion cmake/Platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ if(USE_FPIC)
list(APPEND EXTERNAL_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DSDL_STATIC_PIC=ON)
endif()

# Force ninja to use response files on windows when command line might be too long otherwise
if(CMAKE_HOST_WIN32)
SET(CMAKE_NINJA_FORCE_RESPONSE_FILE ON CACHE INTERNAL "" FORCE)
endif()

if(EMSCRIPTEN)
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
add_compile_options(-g1 -Os)
Expand Down Expand Up @@ -117,7 +122,11 @@ if(NOT MSVC)
add_compile_options(-ffast-math -fno-finite-math-only -funroll-loops -Wno-multichar)
endif()

if((WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug") OR FORCE_USE_LLD)
if(WIN32 AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
set(USE_LLD_DEFAULT ON)
endif()
option(USE_LLD "Override linker tools to use lld & llvm-ar/ranlib" ${USE_LLD_DEFAULT})
if(USE_LLD)
add_link_options(-fuse-ld=lld)
SET(CMAKE_AR llvm-ar)
SET(CMAKE_RANLIB llvm-ranlib)
Expand Down
6 changes: 4 additions & 2 deletions cmake/Rust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ else()
endif()
message(STATUS "RUST_BUILD_SUBDIR = ${RUST_BUILD_SUBDIR}")

set(RUST_FLAGS ${RUST_FLAGS} -Ctarget-cpu=${ARCH})
if(ARCH)
list(APPEND RUST_FLAGS -Ctarget-cpu=${ARCH})
endif()

if(RUST_USE_LTO)
set(RUST_FLAGS ${RUST_FLAGS} -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld)
list(APPEND RUST_FLAGS -Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld)
endif()

if(EMSCRIPTEN_PTHREADS)
Expand Down
3 changes: 2 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/site
/docs/shards/**/*.md
/docs/reference/shards/**/*.md
/docs/reference/enums/**/*.md
2 changes: 1 addition & 1 deletion docs/docs/.pages
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nav:
- index.md
- docs
- reference
- learn
- contribute
- About Us: https://fragcolor.xyz
4 changes: 2 additions & 2 deletions docs/docs/contribute/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ license: CC-BY-SA-4.0

# Documenting the API

*Note that as of 2021/10/25, the **API Documentation** for the shards is extracted from the shards binary using the infos-docs.edn script.*
*Note that as of 2021/10/25, the **API Documentation** for the shards is extracted from the shards binary using the generate.edn script.*

```
./src/build/shards src/tests/infos-docs.edn
./src/build/shards docs/generate.edn
```

If you wish to contribute, you can check out our guide on [how to start documenting](./start-documenting.md).
Expand Down
5 changes: 0 additions & 5 deletions docs/docs/docs/.pages

This file was deleted.

13 changes: 0 additions & 13 deletions docs/docs/docs/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ These documents will help you understand, use, and contribute to Fragcolor techn
You can start from a high-level topic below or use the navigation links at the top.

- [Shards](./learn/shards/)
- [Built-in functions](./docs/functions/)
- [Reference](./reference/)
- [Contributions guides](./contribute/)

*Use the search box if you're looking for something specific.*
Expand Down
1 change: 1 addition & 0 deletions docs/docs/learn/shards/.pages
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nav:
- index.md
- introduction.md
- what-is-shards.md
- the-flow.md
- working-with-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The execution of Shards scripts is meant to be fast: the scripting language is j
The runtime itself is completely detached.

??? note "Running code samples"
Many shard code samples (like for the shard [Take](/General/Take)) do not include the wire/mesh context they need to run. To run these samples you need to navigate to `../shards/docs/samples/`and use the following command to provide the necessary boilerplate code to these samples.
Many shard code samples (like for the shard [Take](./shards/General/Take)) do not include the wire/mesh context they need to run. To run these samples you need to navigate to `../shards/docs/samples/`and use the following command to provide the necessary boilerplate code to these samples.

```
cd docs/samples
Expand Down
Loading