Permalink
Browse files

Merge pull request #12561 from aeslaughter/MOOSEDocs-images

Moose docs images
  • Loading branch information...
rwcarlsen committed Nov 30, 2018
2 parents aded996 + 7f61df2 commit 199ac357e839cd64d2c72cc39ef39a66e993ea8c
@@ -88,6 +88,14 @@ a {
margin-top:10px;
}
.card .card-content{
padding:10px;
}
.card-content img{
width:100%;
}
.moose-exception {
color: red;
}
@@ -61,7 +61,8 @@ def createToken(self, parent, info, page):
node = self.translator.findPage(src)
location = unicode(node.relativeSource(page))
flt = floats.create_float(parent, self.extension, self.reader, page, self.settings)
flt = floats.create_float(parent, self.extension, self.reader, page, self.settings,
**self.attributes)
self.createMedia(flt, info, page, location, **self.attributes)
if flt.children[0].name == 'Caption':
cap = flt.children[0]
@@ -74,7 +75,10 @@ class ImageCommand(MediaCommandBase):
SUBCOMMAND = ('jpg', 'jpeg', 'gif', 'png', 'svg', None)
def createMedia(self, parent, info, page, src, **kwargs):
return Image(parent, src=src, **kwargs)
if parent.name == 'Float':
return Image(parent, src=src)
else:
return Image(parent, src=src, **kwargs)
class VideoCommand(MediaCommandBase):
COMMAND = 'media'
@@ -15,3 +15,12 @@ Montana: [montana-flag]
New York: [newyork-flag]
Idaho: [idaho-flag]
## Width
!media https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg style=width:15%;
!media https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg
caption=Width is set to 15%
style=width:15%;
@@ -1 +1 @@
<!DOCTYPE html><head><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script></head><body><h1 id="config-extension">Config Extension</h1><div class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg" id="michigan-flag"></img><p class="moose-caption"><span class="moose-caption-heading">Flag 1: </span><span class="moose-caption-text">Michigan</span></p></div></body>
<!DOCTYPE html><head><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script></head><body><h1 id="config-extension">Config Extension</h1><div class="moose-float-div" id="michigan-flag"><img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg"></img><p class="moose-caption"><span class="moose-caption-heading">Flag 1: </span><span class="moose-caption-text">Michigan</span></p></div></body>
@@ -1 +1 @@
<!DOCTYPE html><head><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script></head><body><h1 id="media-extension">Media Extension</h1><img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg"></img><div class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/5/54/Flag_of_Washington.svg"></img><p class="moose-caption"><span class="moose-caption-text">Washington state flag.</span></p></div><div class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_Montana.svg" id="montana-flag"></img><p class="moose-caption"><span class="moose-caption-heading">Figure 1: </span><span class="moose-caption-text">Montana state flag.</span></p></div><div class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/1/1a/Flag_of_New_York.svg" style="width:100%;" id="newyork-flag"></img><p class="moose-caption"><span class="moose-caption-heading">Figure 2: </span><span class="moose-caption-text">New York state flag.</span></p></div><div class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/a/a4/Flag_of_Idaho.svg" id="idaho-flag"></img><p class="moose-caption"><span class="moose-caption-heading">Flag 1: </span><span class="moose-caption-text">Idaho state flag.</span></p></div><p>Montana: <a href="#montana-flag">Figure 1</a></p><p>New York: <a href="#newyork-flag">Figure 2</a></p><p>Idaho: <a href="#idaho-flag">Flag 1</a> </p></body>
<!DOCTYPE html><head><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script></head><body><h1 id="media-extension">Media Extension</h1><img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg"></img><div class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/5/54/Flag_of_Washington.svg"></img><p class="moose-caption"><span class="moose-caption-text">Washington state flag.</span></p></div><div class="moose-float-div" id="montana-flag"><img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_Montana.svg"></img><p class="moose-caption"><span class="moose-caption-heading">Figure 1: </span><span class="moose-caption-text">Montana state flag.</span></p></div><div style="width:100%;" class="moose-float-div" id="newyork-flag"><img src="https://upload.wikimedia.org/wikipedia/commons/1/1a/Flag_of_New_York.svg"></img><p class="moose-caption"><span class="moose-caption-heading">Figure 2: </span><span class="moose-caption-text">New York state flag.</span></p></div><div class="moose-float-div" id="idaho-flag"><img src="https://upload.wikimedia.org/wikipedia/commons/a/a4/Flag_of_Idaho.svg"></img><p class="moose-caption"><span class="moose-caption-heading">Flag 1: </span><span class="moose-caption-text">Idaho state flag.</span></p></div><p>Montana: <a href="#montana-flag">Figure 1</a></p><p>New York: <a href="#newyork-flag">Figure 2</a></p><p>Idaho: <a href="#idaho-flag">Flag 1</a></p><h2 id="width">Width</h2><img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg" style="width:15%;"></img><div style="width:15%;" class="moose-float-div"><img src="https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg"></img><p class="moose-caption"><span class="moose-caption-text">Width is set to 15%</span></p></div></body>
@@ -49,17 +49,17 @@
},
{
"attributes": {
"class": "",
"id": "michigan-flag",
"img": false,
"recursive": true
"recursive": true,
"style": ""
},
"children": [
{
"attributes": {
"class": "",
"id": "michigan-flag",
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg",
"style": ""
"src": "https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg"
},
"children": [],
"name": "Image"
@@ -60,17 +60,17 @@
},
{
"attributes": {
"class": "",
"id": "",
"img": false,
"recursive": true
"recursive": true,
"style": ""
},
"children": [
{
"attributes": {
"class": "",
"id": "",
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/5/54/Flag_of_Washington.svg",
"style": ""
"src": "https://upload.wikimedia.org/wikipedia/commons/5/54/Flag_of_Washington.svg"
},
"children": [],
"name": "Image"
@@ -139,17 +139,17 @@
},
{
"attributes": {
"class": "",
"id": "montana-flag",
"img": false,
"recursive": true
"recursive": true,
"style": ""
},
"children": [
{
"attributes": {
"class": "",
"id": "montana-flag",
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_Montana.svg",
"style": ""
"src": "https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_Montana.svg"
},
"children": [],
"name": "Image"
@@ -218,17 +218,17 @@
},
{
"attributes": {
"class": "",
"id": "newyork-flag",
"img": false,
"recursive": true
"recursive": true,
"style": "width:100%;"
},
"children": [
{
"attributes": {
"class": "",
"id": "newyork-flag",
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/1/1a/Flag_of_New_York.svg",
"style": "width:100%;"
"src": "https://upload.wikimedia.org/wikipedia/commons/1/1a/Flag_of_New_York.svg"
},
"children": [],
"name": "Image"
@@ -313,17 +313,17 @@
},
{
"attributes": {
"class": "",
"id": "idaho-flag",
"img": false,
"recursive": true
"recursive": true,
"style": ""
},
"children": [
{
"attributes": {
"class": "",
"id": "idaho-flag",
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/a/a4/Flag_of_Idaho.svg",
"style": ""
"src": "https://upload.wikimedia.org/wikipedia/commons/a/a4/Flag_of_Idaho.svg"
},
"children": [],
"name": "Image"
@@ -531,17 +531,159 @@
},
"children": [],
"name": "ShortcutLink"
}
],
"name": "Paragraph"
},
{
"attributes": {
"class": "",
"id": "",
"level": 2,
"recursive": true,
"style": ""
},
"children": [
{
"attributes": {
"recursive": true,
"text": "Width"
},
"children": [],
"name": "Label"
},
{
"attributes": {
"count": 1,
"content": "Width",
"recursive": true
},
"children": [],
"name": "Break"
"name": "Word"
}
],
"name": "Paragraph"
"name": "Heading"
},
{
"attributes": {
"class": "",
"id": "",
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg",
"style": "width:15%;"
},
"children": [],
"name": "Image"
},
{
"attributes": {
"class": "",
"id": "",
"img": false,
"recursive": true,
"style": "width:15%;"
},
"children": [
{
"attributes": {
"recursive": true,
"src": "https://upload.wikimedia.org/wikipedia/commons/b/b5/Flag_of_Michigan.svg"
},
"children": [],
"name": "Image"
},
{
"attributes": {
"key": "",
"number": 2,
"prefix": "",
"recursive": true
},
"children": [
{
"attributes": {
"content": "Width",
"recursive": true
},
"children": [],
"name": "Word"
},
{
"attributes": {
"count": 1,
"recursive": true
},
"children": [],
"name": "Space"
},
{
"attributes": {
"content": "is",
"recursive": true
},
"children": [],
"name": "Word"
},
{
"attributes": {
"count": 1,
"recursive": true
},
"children": [],
"name": "Space"
},
{
"attributes": {
"content": "set",
"recursive": true
},
"children": [],
"name": "Word"
},
{
"attributes": {
"count": 1,
"recursive": true
},
"children": [],
"name": "Space"
},
{
"attributes": {
"content": "to",
"recursive": true
},
"children": [],
"name": "Word"
},
{
"attributes": {
"count": 1,
"recursive": true
},
"children": [],
"name": "Space"
},
{
"attributes": {
"content": "15",
"recursive": true
},
"children": [],
"name": "Number"
},
{
"attributes": {
"content": "%",
"recursive": true
},
"children": [],
"name": "Punctuation"
}
],
"name": "Caption"
}
],
"name": "Float"
},
{
"attributes": {
@@ -2,4 +2,5 @@
\chapter{\label{media-extension}Media Extension}
\par Montana: \href{\#montana-flag}{}
\par New York: \href{\#newyork-flag}{}
\par Idaho: \href{\#idaho-flag}{}
\par Idaho: \href{\#idaho-flag}{}
\section{\label{width}Width}
Oops, something went wrong.

0 comments on commit 199ac35

Please sign in to comment.