mirror of
https://github.com/ToshioCP/Gtk4-tutorial.git
synced 2024-11-16 19:50:35 +01:00
Bug fixed.
This commit is contained in:
parent
4bee0aa103
commit
2b2929e090
5 changed files with 21 additions and 5 deletions
4
Rakefile
4
Rakefile
|
@ -113,7 +113,7 @@ task pdf: %w[latex/main.tex] do
|
|||
sh "mv latex/main.pdf latex/gtk4_tutorial.pdf"
|
||||
end
|
||||
|
||||
file "latex/main.tex" => [abstract_tex] + sectexfiles + othertexfiles do
|
||||
file "latex/main.tex" => [abstract_tex] + texfiles do
|
||||
gen_main_tex "latex", abstract.to_tex, sectexfiles, othertexfiles
|
||||
end
|
||||
|
||||
|
@ -124,7 +124,7 @@ file abstract_tex => abstract do
|
|||
File.delete(abstract_md)
|
||||
end
|
||||
|
||||
(0...srcfiles.size).each do |i|
|
||||
(0...texfiles.size).each do |i|
|
||||
file texfiles[i] => [srcfiles[i]] + srcfiles[i].c_files do
|
||||
tex_md = "latex/#{srcfiles[i].to_md}"
|
||||
src2md srcfiles[i], tex_md, "latex"
|
||||
|
|
|
@ -159,7 +159,7 @@ char *s;
|
|||
s = g_new (char, 10);
|
||||
/* s points an array of char. The size of the array is 10. */
|
||||
|
||||
struct tuple (int x, int y) *t;
|
||||
struct tuple {int x, y;} *t;
|
||||
t = g_new (struct tuple, 5);
|
||||
/* t points an array of struct tuple. */
|
||||
/* The size of the array is 5. */
|
||||
|
|
|
@ -329,7 +329,7 @@ def change_link src, old_dir, type, new_dir=nil
|
|||
when "html"
|
||||
"#{name}(#{target})"
|
||||
when "latex"
|
||||
chunk
|
||||
"#{name}(#{target})#{size}"
|
||||
end
|
||||
else
|
||||
p_target = Pathname.new "#{old_dir}/#{target}"
|
||||
|
|
|
@ -157,7 +157,7 @@ char *s;
|
|||
s = g_new (char, 10);
|
||||
/* s points an array of char. The size of the array is 10. */
|
||||
|
||||
struct tuple (int x, int y) *t;
|
||||
struct tuple {int x, y;} *t;
|
||||
t = g_new (struct tuple, 5);
|
||||
/* t points an array of struct tuple. */
|
||||
/* The size of the array is 5. */
|
||||
|
|
|
@ -878,6 +878,22 @@ class Test_lib_src_file < Minitest::Test
|
|||
assert_equal files_src2md()[:sample_md_gfm], dst_md["gfm"]
|
||||
assert_equal files_src2md()[:sample_md_html], dst_md["html"]
|
||||
assert_equal files_src2md()[:sample_md_latex], dst_md["latex"]
|
||||
|
||||
temp = "temp"+Time.now.to_f.to_s.gsub(/\./,'')
|
||||
src_dir = "#{temp}/src"
|
||||
dst_dir = "#{temp}/dst"
|
||||
Dir.mkdir(temp) unless Dir.exist?(temp)
|
||||
Dir.mkdir(src_dir) unless Dir.exist?(src_dir)
|
||||
Dir.mkdir(dst_dir) unless Dir.exist?(dst_dir)
|
||||
File.write("#{src_dir}/sample.src.md", "![image](image/image.png){width=8cm hight=6cm}\n")
|
||||
["gfm", "html", "latex"].each do |d|
|
||||
src2md "#{src_dir}/sample.src.md", "#{dst_dir}/sample.md", d
|
||||
dst_md[d] = File.read "#{dst_dir}/sample.md"
|
||||
end
|
||||
remove_entry_secure(temp)
|
||||
assert_equal "![image](../src/image/image.png)\n", dst_md["gfm"]
|
||||
assert_equal "![image](../src/image/image.png)\n", dst_md["html"]
|
||||
assert_equal "![image](../src/image/image.png){width=8cm hight=6cm}\n", dst_md["latex"]
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue