Commit 9e7258d8 by Vasyl Nakvasiuk

fix rakefile, fix docs

parent be27dfd5
...@@ -22,12 +22,12 @@ The main container for a single instance of Conditional module. The following at ...@@ -22,12 +22,12 @@ The main container for a single instance of Conditional module. The following at
be specified for this tag:: be specified for this tag::
sources - location id of required modules, separated by ';' sources - location id of required modules, separated by ';'
message - message for case, where one or more are not passed. Here you can use variable {link}, which generate link to required module. [message | ""] - message for case, where one or more are not passed. Here you can use variable {link}, which generate link to required module.
completed - map to `is_completed` module method [completed] - map to `is_completed` module method
attempted - map to `is_attempted` module method [attempted] - map to `is_attempted` module method
poll_answer - map to `poll_answer` module attribute [poll_answer] - map to `poll_answer` module attribute
voted - map to `voted` module attribute [voted] - map to `voted` module attribute
show tag show tag
-------- --------
...@@ -47,9 +47,9 @@ Examples of conditional depends on poll ...@@ -47,9 +47,9 @@ Examples of conditional depends on poll
<conditional sources="i4x://MITx/0.000x/poll_question/first_real_poll_seq_with_reset" poll_answer="man" <conditional sources="i4x://MITx/0.000x/poll_question/first_real_poll_seq_with_reset" poll_answer="man"
message="{link} must be answered for this to become visible."> message="{link} must be answered for this to become visible.">
<html> <html>
<h2>You see this, cause your vote value for "First question" was "man"</h2> <h2>You see this, cause your vote value for "First question" was "man"</h2>
</html> </html>
</conditional> </conditional>
Examples of conditional depends on poll (use <show> tag) Examples of conditional depends on poll (use <show> tag)
...@@ -59,9 +59,9 @@ Examples of conditional depends on poll (use <show> tag) ...@@ -59,9 +59,9 @@ Examples of conditional depends on poll (use <show> tag)
<conditional sources="i4x://MITx/0.000x/poll_question/first_real_poll_seq_with_reset" poll_answer="man" <conditional sources="i4x://MITx/0.000x/poll_question/first_real_poll_seq_with_reset" poll_answer="man"
message="{link} must be answered for this to become visible."> message="{link} must be answered for this to become visible.">
<html> <html>
<show sources="i4x://MITx/0.000x/problem/test_1; i4x://MITx/0.000x/Video/Avi_resources; i4x://MITx/0.000x/problem/test_1"/> <show sources="i4x://MITx/0.000x/problem/test_1; i4x://MITx/0.000x/Video/Avi_resources; i4x://MITx/0.000x/problem/test_1"/>
</html> </html>
</conditional> </conditional>
Examples of conditional depends on problem Examples of conditional depends on problem
......
...@@ -22,9 +22,9 @@ poll_question tag ...@@ -22,9 +22,9 @@ poll_question tag
Xmodule for creating poll functionality - voting system. The following attributes can Xmodule for creating poll functionality - voting system. The following attributes can
be specified for this tag:: be specified for this tag::
name - Name name - Name of xmodule.
display_name - Display name [display_name| AUTOGENERATE] - Display name of xmodule. When this attribute is not defined - display name autogenerate with some hash.
reset - Can reset/revote many time (value = True/False) [reset | False] - Can reset/revote many time (value = True/False)
answer tag answer tag
......
...@@ -487,60 +487,55 @@ task :autodeploy_properties do ...@@ -487,60 +487,55 @@ task :autodeploy_properties do
end end
end end
# --- Develop documentation ---
desc "Invoke sphinx 'make build' to generate docs."
task :builddocs do
Dir.chdir('docs') do
sh('make html')
end
end
desc "Show docs in browser (mac and ubuntu)." task :tst, [:options] do |t, args|
task :showdocs do puts args.options
Dir.chdir('docs/build/html') do if args.options == 'pub'
if RUBY_PLATFORM.include? 'darwin' # mac os path = "doc/public"
sh('open index.html') else
elsif RUBY_PLATFORM.include? 'linux' # make more ubuntu specific? path = "docs"
sh('sensible-browser index.html') # ubuntu
else
raise "\nUndefined how to run browser on your machine.
Please use 'rake builddocs' and then manually open
'mitx/docs/build/html/index.html."
end
end end
end
desc "Build docs and show them in browser" puts vvv
task :doc => :builddocs do
Rake::Task["showdocs"].invoke
end end
# --- Develop documentation ---
# --- Public documentation --- # --- Develop and public documentation ---
desc "Invoke sphinx 'make build' to generate docs." desc "Invoke sphinx 'make build' to generate docs."
task :buildpubdocs do task :builddocs, [:options] do |t, args|
Dir.chdir('doc/public') do if args.options == 'pub'
path = "doc/public"
else
path = "docs"
end
Dir.chdir(path) do
sh('make html') sh('make html')
end end
end end
desc "Show docs in browser (mac and ubuntu)." desc "Show docs in browser (mac and ubuntu)."
task :showpubdocs do task :showdocs, [:options] do |t, args|
Dir.chdir('doc/public/build/html') do if args.options == 'pub'
path = "doc/public"
else
path = "docs"
end
Dir.chdir("#{path}/build/html") do
if RUBY_PLATFORM.include? 'darwin' # mac os if RUBY_PLATFORM.include? 'darwin' # mac os
sh('open index.html') sh('open index.html')
elsif RUBY_PLATFORM.include? 'linux' # make more ubuntu specific? elsif RUBY_PLATFORM.include? 'linux' # make more ubuntu specific?
sh('sensible-browser index.html') # ubuntu sh('sensible-browser index.html') # ubuntu
else else
raise "\nUndefined how to run browser on your machine. raise "\nUndefined how to run browser on your machine.
Please use 'rake showpubdocs' and then manually open Please use 'rake builddocs' and then manually open
'mitx/doc/public/build/html/index.html." 'mitx/#{path}/build/html/index.html."
end end
end end
end end
desc "Build docs and show them in browser" desc "Build docs and show them in browser"
task :pubdoc => :buildpubdocs do task :doc, [:options] => :builddocs do |t, args|
Rake::Task["showpubdocs"].invoke Rake::Task["showdocs"].invoke(args.options)
end end
# --- Public documentation --- # --- Develop and public documentation ---
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment