Coder Social home page Coder Social logo

mosra / magnum-website Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 12.0 81.99 MB

Website for the Magnum C++11 graphics engine

Home Page: http://magnum.graphics/

Python 11.41% JavaScript 12.00% CSS 2.90% HTML 36.43% C++ 37.08% CMake 0.18%
m-css pelican magnum html5 python doxygen webdesign restructuredtext

magnum-website's Introduction

Magnum website

Content for https://magnum.graphics/.

In order to set up a local copy (for example for writing a guest post), you need Python 3 with Pelican, Pyphen and Pillow packages installed and optionally some LaTeX distribution for math rendering.

On ArchLinux it's the following packages:

sudo pacman -S texlive-most pelican python-pillow python-matplotlib
cower -d python-pyphen # Build the python-pyphen package from AUR

On Ubuntu you need these:

sudo apt install texlive-base texlive-latex-extra texlive-fonts-extra python3-matplotlib graphviz
pip3 install pelican Pyphen Pillow

On Windows and macOS pick some LaTeX distribution and make it available in the PATH. Python packages can be installed via pip3 as well:

pip3 install pelican Pyphen Pillow matplotlib

Note: Setting up LaTeX might be problematic and so the website doesn't strictly require it to make life easier for you --- if LaTeX is not found, it will render math formulas as unformatted code instead.

Next, make sure to clone the repository (or your fork of the repository) including submodules so m.css is properly included (use git clone --recursive, for example).

That's it. Now you can build the website and start a webserver on http://localhost:8000 with the following command. The website is automatically rebuilt on changes in the input files.

cd magnum-website
pelican -Dlr

Note: If you are on Windows and you don't have Git symlinks enabled, you either need to reinstall Git with symlinks enabled (there's a checkbox for that in the installation wizard) or copy m.css/css/*.css to output/inc/*, otherwise the built website will lack all styling. Sorry for the inconvenience.

If you run into problems, please open an issue. The m.css documentation might also help. Thank you.

Pelican workarounds and publishing notes

magnum-website's People

Contributors

costashatz avatar li6in9muyou avatar mjjbennett avatar mosra avatar squareys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

magnum-website's Issues

Error while trying to build based on the readme

hi!

I am getting an error when I do the steps in this:
https://github.com/mosra/magnum-website/blob/master/README.rst

Here is what I do:

git clone --recursive [email protected]:mosra/magnum-website.git
pelican -Dlr

and I have installed pelican Pyphen Pillow matplotlib.

I get:

➤ pelican -Dlr
DEBUG: Pelican version: 4.5.0
DEBUG: Python version: 3.6.10
DEBUG: Adding current directory to system path
DEBUG: Finding namespace plugins
DEBUG: Loading plugin `m.abbr`
DEBUG: Loading plugin `m.alias`
DEBUG: Loading plugin `m.code`
DEBUG: Loading plugin `m.components`
DEBUG: Loading plugin `m.dot`
DEBUG: Loading plugin `m.dox`
DEBUG: Loading plugin `m.filesize`
DEBUG: Loading plugin `m.gh`
DEBUG: Loading plugin `m.gl`
DEBUG: Loading plugin `m.htmlsanity`
DEBUG: Loading plugin `m.images`
DEBUG: Loading plugin `m.link`
DEBUG: Loading plugin `m.math`
DEBUG: Loading plugin `m.metadata`
DEBUG: Loading plugin `m.plots`
DEBUG: CONFIGDIR=/Users/fnrizzi/.matplotlib
DEBUG: (private) matplotlib data path: /Users/fnrizzi/Library/Python/3.6/lib/python/site-packages/matplotlib/mpl-data
DEBUG: matplotlib data path: /Users/fnrizzi/Library/Python/3.6/lib/python/site-packages/matplotlib/mpl-data
DEBUG: loaded rc file /Users/fnrizzi/Library/Python/3.6/lib/python/site-packages/matplotlib/mpl-data/matplotlibrc
DEBUG: matplotlib version 3.2.2
DEBUG: interactive is False
DEBUG: platform is darwin
DEBUG: loaded modules:  /// a long list
DEBUG: CACHEDIR=/Users/fnrizzi/.matplotlib
DEBUG: Using fontManager instance from /Users/fnrizzi/.matplotlib/fontlist-v310.json
DEBUG: Loaded backend agg version unknown.
DEBUG: Loading plugin `m.sphinx`
DEBUG: Loading plugin `m.vk`
DEBUG: Registering plugin `m.abbr`
DEBUG: Registering plugin `m.alias`
ERROR: Cannot register plugin `m.alias`
  | No module named 'pelican.signals'
DEBUG: Registering plugin `m.code`
ERROR: Cannot register plugin `m.code`
  | No module named 'pelican.signals'
DEBUG: Registering plugin `m.components`
DEBUG: Registering plugin `m.dot`
/// a bunch more similar errors

I also had to add the m.css/plugins to my pythonpath to get to this point.
Am I missing something?
Thanks for the help!

Showcase examples not loading due to CORS rejection

Here's a console dump from Firefox Quantum 57.0.3 (64-bit) on macOS 10.12.6 (16G1036):

loading pref showConsoleLogs before prefs were initialised, you will not get the correct result
content-script.bundle.js:333:7
failed to asynchronously prepare wasm: TypeError: NetworkError when attempting to fetch resource.
EmscriptenApplication.js:15:9
TypeError: NetworkError when attempting to fetch resource.
EmscriptenApplication.js:19:9
TypeError: NetworkError when attempting to fetch resource.
EmscriptenApplication.js:15:9
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.wasm. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
uncaught exception: abort({}) at jsStackTrace@http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:17995
stackTrace@http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:18166
abort@http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:232082
doNativeWasm/<@http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:29561

If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

In particular: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.wasm. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Similar thing in Chrome 63.0.3239.84 (Official Build) (64-bit):

Failed to load http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.wasm: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://magnum.graphics' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
EmscriptenApplication.js:15 failed to asynchronously prepare wasm: TypeError: Failed to fetch
printErr @ EmscriptenApplication.js:15
(anonymous) @ magnum-textured-triangle.js:1
Promise rejected (async)
doNativeWasm @ magnum-textured-triangle.js:1
Module.asm @ magnum-textured-triangle.js:1
(anonymous) @ magnum-textured-triangle.js:1
EmscriptenApplication.js:19 TypeError: Failed to fetch
EmscriptenApplication.js:15 TypeError: Failed to fetch
printErr @ EmscriptenApplication.js:15
abort @ magnum-textured-triangle.js:1
(anonymous) @ magnum-textured-triangle.js:1
Promise rejected (async)
doNativeWasm @ magnum-textured-triangle.js:1
Module.asm @ magnum-textured-triangle.js:1
(anonymous) @ magnum-textured-triangle.js:1
magnum.graphics/:1 Uncaught (in promise) abort({}) at Error
    at jsStackTrace (http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:17995)
    at stackTrace (http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:18166)
    at abort (http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:232082)
    at http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.js:1:29561
    at <anonymous>
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

Relevant part: Failed to load http://static.magnum.graphics/showcase/textured-triangle/magnum-textured-triangle.wasm: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Using the "Allow-Control-Allow-Origin: *" Chrome Extension resolves this on Chrome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.