bibtex2html 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2925bdd464076ff4fb5d8d16284a388a5b8b3c0
4
- data.tar.gz: afdb35327609a3b7f24f7f2929ee934d1e4bdb11
3
+ metadata.gz: 20c9063a44677965f0742c1dd9767ed94fc7da53
4
+ data.tar.gz: 1b2393b7a55e0d4f6e250d00120947f6d21499f7
5
5
  SHA512:
6
- metadata.gz: f6ce8930f8dd5e1d305c41e2db07dc08bc5e31c45b973ec6838c5c73f4b2f892b61cfbcd0ad04150098d20a080b5b784df64a646c2a6f716bb067cc007dec0e1
7
- data.tar.gz: 018b42d14da6cd7108bf455aa7cc0d2e7e833ea2dae5b223bbbfb2d7818913fb4d4b600d156c92cb97f7b408cee2fd1454f051c9f316cce25e17fa5cb2b38183
6
+ metadata.gz: c95f356d0fc5794896fedfa0af04c290c0f4349f6e7456d4fb2d305278cef39a85b97b04d3b42ed89ece7d624782d6a51cf9afd25a2c179fa24c2980b150efd2
7
+ data.tar.gz: 540793e2332707f63ea756d42a2cb1e37570c4870795fc683a918887c5e66d2211e1c21209c0fc513707766fef1632bc8f141db87ce0c7f66b6cc8e5ac356b67
@@ -1,4 +1,5 @@
1
1
  require "bibtex2html/version"
2
+ require "bibtex2html/convert"
2
3
 
3
4
  module Bibtex2html
4
5
  # Your code goes here...
@@ -1,11 +1,26 @@
1
- # -+- coding: utf-8 -*-
2
1
  require "bibtex2html/version"
3
2
  require "bibtex"
3
+ require "cgi"
4
4
 
5
5
  module Bibtex2html
6
+ module_function
7
+
6
8
  def convert item
9
+ doc = "<div class='bibitem'>"
7
10
  bibitem = BibTeX.parse item
8
- p bibitem
11
+ bibitem.each do |attributes|
12
+ attributes.each do |key, values|
13
+ doc += "<h3>#{CGI.escapeHTML key.to_s}</h3>"
14
+ doc += "<ul>"
15
+
16
+ values.to_a.each do |value|
17
+ doc += "<li>#{CGI.escapeHTML value}</li>"
18
+ end
19
+ doc += "</ul>"
20
+ end
21
+ end
22
+ doc += "</div>"
23
+
9
24
  return doc
10
25
  end
11
26
  end
@@ -1,3 +1,3 @@
1
1
  module Bibtex2html
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibtex2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - himkt