Comments (10)
@aaronmarkham have we resolved this issue yet?
from new-docs.
Yes, on D2L we copy images in Makefile.
from new-docs.
thanks @astonzhang, couldn't find any specific reference to images though. Are you just copying all file types as part of this line? We're going to be placing images in the same directory as the guide, since this is the easiest to maintain so we'll need to add something a bit different in our Makefile.
from new-docs.
So far I have a command that copies image and video content into the build directory (working on MacOS and Ubuntu) that can be used in the Makefile:
rsync -arv --prune-empty-dirs --include "*/" --include="*.png" --include="*.jpeg" --include="*.jpg" --exclude="*" "./guide/" "./build/_build/html/guide"
And a web server that serves images (python -m http.server
doesn't by default). Just installed twisted
and ran using:
sudo apt-get install python-twisted-web
twistd -no web --path=build/_build/html --port tcp:8000
So images are hosted at the correct location. Only thing left to fix is the path to the images from the html files. ![alt](./imgs/NCHW_BN.png)
in the markdown gets converted to http://localhost:8000/guide/packages/gluon/normalization/guide/packages/gluon/normalization/imgs/NTC_IN.png
instead of http://localhost:8000/guide/packages/gluon/normalization/imgs/NTC_IN.png
. Any ideas on this one @aaronmarkham?
from new-docs.
I think you want this instead:
rsync -arv --prune-empty-dirs --include "*/" --include="*.png" --include="*.jpeg" --include="*.jpg" --exclude="*" "./guide/" "./build/guide"
I wouldn't put anything in _build as that's the output directory for Sphinx. It should find what you have in /build/ and use that to transform to html and deposit it in the _build/html folder.
from new-docs.
Still a lot of mess to sort out here. I have both images and video showing with the following.
-
Make sure all markdown images have unique descriptions (e.g.
![description](./path/to/image.png)
). Without this strange things happened, and I ended up with all images being replaced with the same image (i.e. don't use blank description like![](./path/to/image.png)
) -
Copy images to
./build/guide
using...
rsync -arv --prune-empty-dirs --include "*/" --include="*.png" --include="*.jpeg" --include="*.jpg" --exclude="*" "./guide/" "./build/guide"
-
make EVAL=0
-
Copy video to the
_build
directory since references in HTML tags (e.g.<video>
) aren't modified, and don't move across correctly. Might also need this for images that are referenced using<img>
tag in the markdown.
rsync -arv --prune-empty-dirs --include "*/" --include="*.mp4" --exclude="*" "./guide/" "./build/_build/html/guide"
- Serve with web server that supports images
twistd -no web --path=build/_build/html --port tcp:8000
from new-docs.
Sure there must be a better way to get around Step 4 there.
from new-docs.
Sure there must be a better way to get around Step 4 there.
Host videos elsewhere? I'm not sure adding mp4s to the repo is a good idea.
from new-docs.
Could do, but these videos are tiny. About the same as an images and we're including them in the repo for simplicity. As an example... https://github.com/mli/new-docs/blob/master/python/guide/packages/autograd/imgs/autograd_graph.mp4
from new-docs.
Ya, that makes sense.
This is from an old forum post... sounds like it would work:
...
For local video files, you can use .. raw:: html
directive.
- Put video files into _static directory
- write
from new-docs.
Related Issues (20)
- searching for functions yields nothing (or hangs) HOT 3
- API docs build doesn't cache unchanged files
- ec2 deploy article edits needed
- sphinx-autogen step references non-existant template
- c_predict_api page build errors
- duplicate object description warnings in Gluon API
- emdash in title doesn't render properly when shared
- NDAbs is missing from docs
- Can find link to Optimizer Guide in navigation
- content updates not appearing on the website HOT 4
- Sync with upstream issue HOT 2
- build fails in CI - blocking PRs HOT 4
- nbsphinx error about pandoc version
- environment update process requires new version of conda >= 4.6.13
- pip warning when updating conda environment with environment.yml
- build tries to convert all markdown files to notebooks (and fails)
- api reference to mxnet.random.seed causing errors
- Code links don't render correctly
- MXNet Gluon Consistency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from new-docs.