Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
c6d973bd
Commit
c6d973bd
authored
Jul 03, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the markdown extensions to work with wiki namespaces.
parent
e1225834
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
lms/djangoapps/simplewiki/mdx_circuit.py
+4
-4
lms/djangoapps/simplewiki/mdx_wikipath.py
+5
-2
lms/djangoapps/simplewiki/models.py
+1
-1
lms/static/sass/_shared_forms.scss
+1
-1
lms/static/sass/application.css
+1
-1
No files found.
lms/djangoapps/simplewiki/mdx_circuit.py
View file @
c6d973bd
...
@@ -17,8 +17,6 @@ circuit-schematic:[["r",[128,48,0],{"r":"1","_json_":0},["2","1"]],["view",0,0,2
...
@@ -17,8 +17,6 @@ circuit-schematic:[["r",[128,48,0],{"r":"1","_json_":0},["2","1"]],["view",0,0,2
import
markdown
import
markdown
import
re
import
re
import
simplewiki.settings
as
settings
from
django.utils.html
import
escape
from
django.utils.html
import
escape
try
:
try
:
...
@@ -68,5 +66,7 @@ class CircuitLink(markdown.inlinepatterns.Pattern):
...
@@ -68,5 +66,7 @@ class CircuitLink(markdown.inlinepatterns.Pattern):
return
etree
.
fromstring
(
"<div align='center'><input type='hidden' parts='' value='"
+
data
+
"' analyses='' class='schematic ctrls' width='640' height='480'/></div>"
)
return
etree
.
fromstring
(
"<div align='center'><input type='hidden' parts='' value='"
+
data
+
"' analyses='' class='schematic ctrls' width='640' height='480'/></div>"
)
def
makeExtension
(
configs
=
None
)
:
def
makeExtension
(
configs
=
None
):
return
CircuitExtension
(
configs
=
configs
)
to_return
=
CircuitExtension
(
configs
=
configs
)
print
"circuit returning "
,
to_return
return
to_return
lms/djangoapps/simplewiki/mdx_wikipath.py
View file @
c6d973bd
...
@@ -33,7 +33,7 @@ class WikiPathExtension(markdown.Extension):
...
@@ -33,7 +33,7 @@ class WikiPathExtension(markdown.Extension):
def
__init__
(
self
,
configs
):
def
__init__
(
self
,
configs
):
# set extension defaults
# set extension defaults
self
.
config
=
{
self
.
config
=
{
'
base_url'
:
[
'/'
,
'String to append to beginning or URL
.'
],
'
default_namespace'
:
[
'edX'
,
'Default namespace for when one isn
\'
t specified
.'
],
'html_class'
:
[
'wikipath'
,
'CSS hook. Leave blank for none.'
]
'html_class'
:
[
'wikipath'
,
'CSS hook. Leave blank for none.'
]
}
}
...
@@ -62,7 +62,10 @@ class WikiPath(markdown.inlinepatterns.Pattern):
...
@@ -62,7 +62,10 @@ class WikiPath(markdown.inlinepatterns.Pattern):
if
article_title
.
startswith
(
"/"
):
if
article_title
.
startswith
(
"/"
):
article_title
=
article_title
[
1
:]
article_title
=
article_title
[
1
:]
url
=
self
.
config
[
'base_url'
][
0
]
+
article_title
if
not
"/"
in
article_title
:
article_title
=
self
.
config
[
'default_namespace'
][
0
]
+
"/"
+
article_title
url
=
"../"
+
article_title
label
=
m
.
group
(
'linkTitle'
)
label
=
m
.
group
(
'linkTitle'
)
a
=
etree
.
Element
(
'a'
)
a
=
etree
.
Element
(
'a'
)
a
.
set
(
'href'
,
url
)
a
.
set
(
'href'
,
url
)
...
...
lms/djangoapps/simplewiki/models.py
View file @
c6d973bd
...
@@ -270,7 +270,7 @@ class Revision(models.Model):
...
@@ -270,7 +270,7 @@ class Revision(models.Model):
# Create pre-parsed contents - no need to parse on-the-fly
# Create pre-parsed contents - no need to parse on-the-fly
ext
=
WIKI_MARKDOWN_EXTENSIONS
ext
=
WIKI_MARKDOWN_EXTENSIONS
ext
+=
[
"wikipath(
base_url=
%
s)"
%
reverse
(
'wiki_view'
,
args
=
(
'/'
,))
]
ext
+=
[
"wikipath(
default_namespace=
%
s)"
%
self
.
article
.
namespace
.
name
]
self
.
contents_parsed
=
markdown
(
self
.
contents
,
self
.
contents_parsed
=
markdown
(
self
.
contents
,
extensions
=
ext
,
extensions
=
ext
,
safe_mode
=
'escape'
,)
safe_mode
=
'escape'
,)
...
...
lms/static/sass/_shared_forms.scss
View file @
c6d973bd
form
{
form
{
font-size
:
0
em
;
font-size
:
1
em
;
label
{
label
{
color
:
$base-font-color
;
color
:
$base-font-color
;
...
...
lms/static/sass/application.css
View file @
c6d973bd
...
@@ -1167,7 +1167,7 @@ p.ie-warning {
...
@@ -1167,7 +1167,7 @@ p.ie-warning {
text-align
:
left
;
}
text-align
:
left
;
}
form
{
form
{
font-size
:
0
em
;
}
font-size
:
1
em
;
}
form
label
{
form
label
{
color
:
#3c3c3c
;
color
:
#3c3c3c
;
font
:
normal
1.2rem
/
1.6rem
Georgia
,
Cambria
,
"Times New Roman"
,
Times
,
serif
;
font
:
normal
1.2rem
/
1.6rem
Georgia
,
Cambria
,
"Times New Roman"
,
Times
,
serif
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment