-
Notifications
You must be signed in to change notification settings - Fork 675
Webversion introduction and integration #902
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
base: master
Are you sure you want to change the base?
Changes from all commits
0fe3918
c6fc0d2
6e147a5
788bd1c
ba79b04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: C/C++ CI | ||
| name: Checkers | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,22 +1,36 @@ | ||||||||||
| name: Documentation on github.io | ||||||||||
| name: Docs, Webverion and Deploy | ||||||||||
|
|
||||||||||
| on: | ||||||||||
| push: | ||||||||||
| branches: [ master ] | ||||||||||
| on: [push, pull_request] | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs should only be built on pushes to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify, this is already covered in the Mini FAQ. So my main question is should we build the webversion on pull requests? Now, this PR prefers a "zero surprise" policy, which means we want to catch issues early before merging. This workflow also runs in parallel with
Which would be better?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
just like it was was before, only when pushing to master Getting webver rebuild on each PR is costly and verbose. If it ever breaks, it will most likely be an issue with demo/sdl3_renderer (or with Emscripten, or with SDL itself) so full rebuild is unnecessary. Instead, how about we use something similar to .github/ci_compile_sources.sh that will attempt to compile the demo with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| build-documentation: | ||||||||||
| build: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| steps: | ||||||||||
| - name: checkout | ||||||||||
| uses: actions/checkout@v4 | ||||||||||
| - name: apt-update | ||||||||||
| run: sudo apt-get update -qq | ||||||||||
| - name: apt-get doxygen | ||||||||||
| run: sudo apt-get install -y doxygen | ||||||||||
| #Documentation | ||||||||||
| - name: Install packages for docs | ||||||||||
| run: | | ||||||||||
| sudo apt-get update -qq | ||||||||||
| sudo apt-get install -y doxygen | ||||||||||
|
Comment on lines
+11
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated change |
||||||||||
| - name: build doc | ||||||||||
| run: make docs | ||||||||||
| - name: deploy | ||||||||||
| #Webversion | ||||||||||
| - name: Install packages for webver | ||||||||||
| run: | | ||||||||||
| sudo apt-get update -qq | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already do an update prior to this. Don't need to do it again. |
||||||||||
| sudo apt-get install -y make | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could bundle the |
||||||||||
| - name: Setup Emscripten SDK | ||||||||||
| uses: mymindstorm/setup-emsdk@v14 | ||||||||||
| - name: Verify Emscripten | ||||||||||
| run: emcc -v | ||||||||||
| - name: Build SDL3 port for Emscripten | ||||||||||
| run: embuilder build sdl3 | ||||||||||
| - name: Build webversion | ||||||||||
| run: make webver | ||||||||||
| #Deploy to GitHub Pages | ||||||||||
| - name: Deploy to GitHub Pages | ||||||||||
| if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/feat/webver') }} | ||||||||||
| uses: peaceiris/actions-gh-pages@v4 | ||||||||||
| with: | ||||||||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,9 +5,18 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| ## path stuff | ||||||||||||||||||
| DOCS_PATH:=./doc | ||||||||||||||||||
| # Convenience shortcut to docs output path (as defined in Doxyfile) | ||||||||||||||||||
| DOCS_OUT:=$(DOCS_PATH)/html | ||||||||||||||||||
|
|
||||||||||||||||||
| DEMO_PATH=demo | ||||||||||||||||||
| SRC_PATH=src | ||||||||||||||||||
|
|
||||||||||||||||||
| WEBVER_BACKEND:=./demo/sdl3_renderer | ||||||||||||||||||
| WEBVER_SITE:=./webver/site | ||||||||||||||||||
| WEBVER_OUT:=$(DOCS_OUT)/webver | ||||||||||||||||||
| WEBVER_CFLAGS:=-O2 -DINCLUDE_ALL -sEXPORTED_RUNTIME_METHODS=requestFullscreen | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
| #Possible choice: ccall,cwrap,requestFullscreen,FS | ||||||||||||||||||
| WEBVER_CFLAGS+=${CFLAGS} | ||||||||||||||||||
|
Comment on lines
+14
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this section doesn't belong here. |
||||||||||||||||||
|
|
||||||||||||||||||
| ## Documents settings | ||||||||||||||||||
| DOXYFILE:=$(DOCS_PATH)/Doxyfile | ||||||||||||||||||
|
|
@@ -37,15 +46,16 @@ DEMO_LIST = $(shell find $(DEMO_PATH) -type f -name Makefile -printf "%h ") | |||||||||||||||||
| ###################################################################################### | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| .PHONY: usage all demos $(DEMO_LIST) | ||||||||||||||||||
| .PHONY: usage all demos webver $(DEMO_LIST) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't see a need to build the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| usage: | ||||||||||||||||||
| echo "make docs to create documentation" | ||||||||||||||||||
| echo "make nuke to rebuild the single header nuklear.h from source" | ||||||||||||||||||
| echo "make demos to build all of the demos" | ||||||||||||||||||
| echo "make all to re-pack the header and create documentation" | ||||||||||||||||||
| @echo "make docs to create documentation" | ||||||||||||||||||
| @echo "make webver to build webversion on SDL3 + Emscripten (try to run 'embuilder build sdl3' if first time)" | ||||||||||||||||||
| @echo "make nuke to rebuild the single header nuklear.h from source" | ||||||||||||||||||
| @echo "make demos to build all of the demos" | ||||||||||||||||||
| @echo "make all to re-pack the header and create documentation" | ||||||||||||||||||
|
Comment on lines
+52
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
|
|
||||||||||||||||||
| all: docs nuke demos | ||||||||||||||||||
| all: docs webver nuke demos | ||||||||||||||||||
| demos: $(DEMO_LIST) | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -57,14 +67,12 @@ nuke: $(addprefix $(SRC_PATH)/, $(SRC)) | |||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| ######################################################################################## | ||||||||||||||||||
| ## Docs | ||||||||||||||||||
|
|
||||||||||||||||||
| docs: $(DOCS_PATH)/html/index.html | ||||||||||||||||||
| docs: $(DOCS_OUT)/index.html | ||||||||||||||||||
|
|
||||||||||||||||||
| $(DOCS_PATH)/html/index.html: $(DOCS_PATH)/doxygen-awesome-css/doxygen-awesome.css $(DOXYFILE) | ||||||||||||||||||
| $(DOCS_OUT)/index.html: $(DOCS_PATH)/doxygen-awesome-css/doxygen-awesome.css $(DOXYFILE) | ||||||||||||||||||
| doxygen $(DOXYFILE) | ||||||||||||||||||
|
|
||||||||||||||||||
| $(DOXYFILE): | ||||||||||||||||||
|
|
@@ -75,6 +83,16 @@ $(DOCS_PATH)/doxygen-awesome-css/doxygen-awesome.css: | |||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| ######################################################################################## | ||||||||||||||||||
| ## webver | ||||||||||||||||||
|
RobLoach marked this conversation as resolved.
|
||||||||||||||||||
|
|
||||||||||||||||||
| webver: | ||||||||||||||||||
| mkdir -p $(WEBVER_OUT) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unless you have a very good reason to keep this line, you can probably remove it, and patch this instead diff --git a/demo/sdl3_renderer/Makefile b/demo/sdl3_renderer/Makefile
index 48ee50e..22b83cd 100644
--- a/demo/sdl3_renderer/Makefile
+++ b/demo/sdl3_renderer/Makefile
@@ -47,7 +47,7 @@ DEP := ${TEMPDIR}/$(notdir ${BIN}).d
SRC := main.c
${BIN}:
- mkdir -p $(dir $@)
+ mkdir -p $(dir $@) ${TEMPDIR}
${CC} ${SRC} -o $@ -MD -MF ${DEP} ${cppflags} ${ldflags} ${ldlibs} ${cflags}
${BIN}: ${SRC} |
||||||||||||||||||
| emmake make -C $(WEBVER_BACKEND) CFLAGS="$(WEBVER_CFLAGS)" BIN=$(abspath $(WEBVER_OUT)/demo_sdl3_renderer.js) TEMPDIR=$(abspath $(WEBVER_OUT)) | ||||||||||||||||||
|
Comment on lines
+89
to
+91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this it building out assets, we could take advantage of Makefile's command caching...
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@RobLoach This demo produces more files than just Also, the change that you suggested would not work, because this... webver:
mkdir -p $(WEBVER_OUT)...would only end up calling webver: $(WEBVER_OUT)/demo_sdl3_renderer.js
$(WEBVER_OUT)/demo_sdl3_renderer.js:
mkdir -p $(WEBVER_OUT)
emmake ......but as I said, this is unnecessary. This code is already okey as it is. |
||||||||||||||||||
| cp -r $(WEBVER_SITE)/* $(WEBVER_OUT)/ | ||||||||||||||||||
| #[NOTE]We pass TEMPDIR directly for hide a potential issue | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What potential issue are we hiding? It's probably best to not hide it. Building out to the temp directory instead of the destination directoy seems hacky.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needs tempdir because @PavelSharp What you did with |
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| ######################################################################################## | ||||||||||||||||||
| ## Demos | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -87,4 +105,4 @@ $(DEMO_LIST): | |||||||||||||||||
| ## Utility helpers | ||||||||||||||||||
|
|
||||||||||||||||||
| clean: | ||||||||||||||||||
| rm -rf $(DOCS_PATH)/html $(OUTPUT) | ||||||||||||||||||
| rm -rf $(DOCS_OUT) $(OUTPUT) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename to README.md |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||
| Webversion notes | ||||||||
| === | ||||||||
|
Comment on lines
+1
to
+2
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| ## Terminology | ||||||||
|
|
||||||||
| **Webversion** (or **webver** for short) is a demonstration of Nuklear being run in the browser via Emscripten. | ||||||||
| Currently it supports only the SDL3 backend, but long-term, additional backends may be added. | ||||||||
|
|
||||||||
| We use the consistent term **webversion** because it is already referenced across other files and may appear in user-created issues and pull requests. | ||||||||
|
|
||||||||
| ## Folder Structure | ||||||||
|
|
||||||||
| We use the `site` subfolder to store all public webversion files. | ||||||||
| Current folder contains **internal** files for webversion support that do not need to be published. | ||||||||
|
|
||||||||
| ## Update Policy | ||||||||
|
|
||||||||
| The webversion is auto-updated through CI/CD workflow scripts. Any push triggers an automated build and deployment process, so no manual steps are required. | ||||||||
|
|
||||||||
| ## About Logo | ||||||||
|
|
||||||||
| The Nuklear logo was suggested by Rafał Jopek and published in [issue #401](https://github.com/Immediate-Mode-UI/Nuklear/issues/401#issuecomment-2066737874) | ||||||||
|
Comment on lines
+20
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logo is likely more broadly scoped to the Docs. If we are uploading it, may be good to have it displayed in the main docs, and credited there. |
||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't a real reason to provide the Emscripten logo. Have the minshell be the default one?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These logos are used as hyperlinks, so it would be nice to keep this functionality in one way or another. Also, the images just look nice overall, and make some sense in showcase shell. The only problem I have here is .PNG format. Git doesn't play well with binary files, and small .PNG can't scale with higher resolution. Vendoring this inside of git repo feels wrong. Can't we use .SVG format instead? Aren't web browsers supporting this by default? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this change?