mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Added new incompressibles, cleaned the docs, and improved the log fitting procedures
This commit is contained in:
@@ -92,7 +92,7 @@ class BibTeXerClass(object):
|
||||
return stripped
|
||||
|
||||
|
||||
def getBibliography(self, keys=[], fmt="plaintext", style="unsrtalpha", enc=None, objects=False):
|
||||
def getBibliography(self, keys=None, fmt="plaintext", style="unsrtalpha", enc=None, objects=False):
|
||||
"""This function creates a formatted bibliography according to the
|
||||
defined parameters using Pybtex.
|
||||
Specify your desired output format using the \"fmt\" parameter. Supported
|
||||
@@ -158,7 +158,16 @@ class BibTeXerClass(object):
|
||||
} # How do we find the end of the label?
|
||||
|
||||
end_of_label = contents.index(label_table[fmt])
|
||||
contents = contents[end_of_label+1:].strip()
|
||||
contents = contents[end_of_label+len(label_table[fmt]):].strip()
|
||||
|
||||
if fmt=="latex":
|
||||
contents = contents.replace(u"\\newblock ","")
|
||||
elif fmt=="html":
|
||||
contents = contents.replace(u"<dd>","")
|
||||
contents = contents.replace(u"</dd>","")
|
||||
|
||||
contents = contents.replace(u"\n","")
|
||||
|
||||
return contents
|
||||
|
||||
|
||||
@@ -166,43 +175,15 @@ class BibTeXerClass(object):
|
||||
#getEntry(self, key, label=False, fmt="markdown", style="unsrtalpha", enc=None):
|
||||
|
||||
if __name__=='__main__':
|
||||
B = BibTeXerClass()
|
||||
B.loadLibrary('../../../Web/fluid_properties/Incompressibles.bib')
|
||||
print(B.getEntry('Cesar2013'))
|
||||
print(B.getEntry('Skovrup2013'))
|
||||
print(B.getEntry('Therminol2014'))
|
||||
|
||||
# B = BibTeXerClass('../../../Web/fluid_properties/Incompressibles.bib')
|
||||
# print("\nHTML:")
|
||||
# print(B.entries2All(keys=['Skovrup2013'], output_backend='html'))
|
||||
# print("\nMarkdown:")
|
||||
# print(B.entries2All(keys=['Skovrup2013'], output_backend='markdown'))
|
||||
# print("\nText:")
|
||||
# print(B.entries2All(keys=['Skovrup2013'], output_backend='text'))
|
||||
#
|
||||
# B = BibTeXerClass('../../../CoolPropBibTeXLibrary.bib')
|
||||
# print("\nHTML:")
|
||||
# print(B.entries2All(keys=['Mulero-JPCRD-2012'], output_backend='html'))
|
||||
# print("\nMarkdown:")
|
||||
# print(B.entries2All(keys=['Mulero-JPCRD-2012'], output_backend='markdown'))
|
||||
# print("\nText:")
|
||||
# print(B.entries2All(keys=['Mulero-JPCRD-2012'], output_backend='text'))
|
||||
#
|
||||
#
|
||||
# from pybtex.richtext import Text, Tag, Symbol, HRef
|
||||
# from pybtex.backends.markdown import Backend
|
||||
#
|
||||
# link_href = HRef(
|
||||
# 'http://www.test.test/directory/file.ext?para=in&sec=out', # URL
|
||||
# 'testing links with href class'
|
||||
# )
|
||||
# tag_emph = Tag('emph', Text(u'Emph', Symbol('nbsp'), u'text'))
|
||||
# unicode_text = Text(u'Л.:', Symbol('nbsp'), u'<<Химия>>')
|
||||
# latex_text = Text(u'{\\aa}', Symbol(u'nbsp'), u'\\\'e')
|
||||
# markd_text = Text(u'{ and & and *', Symbol(u'nbsp'), u'\\')
|
||||
#
|
||||
# for i in [link_href,tag_emph,unicode_text,latex_text,markd_text]:
|
||||
# print(i.render(Backend()))
|
||||
B = BibTeXerClass('../../../CoolPropBibTeXLibrary.bib')
|
||||
print("\nLatex:")
|
||||
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='latex'))
|
||||
print("\nHTML:")
|
||||
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='html'))
|
||||
print("\nMarkdown:")
|
||||
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='markdown'))
|
||||
print("\nText:")
|
||||
print(B.getEntry(key='Mulero-JPCRD-2012', fmt='plaintext'))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user