git.s-ol.nu mmm / b270c85
move to DOI references s-ol 1 year, 11 months ago
10 changed file(s) with 57 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
22 parse_bibtex = (src) ->
33 type, key, kv = src\match '@(%w+){(.-),(.*)}'
44 with info = { _type: type, _key: key }
5 for key, val in kv\gmatch '([a-z]-)%s*=%s*{(.-)}'
5 for key, val in kv\gmatch '([a-z]-)%s*=%s*(%b{})'
6 val\sub 2, -2
7 info[key] = val\gsub '[{}]', ''
8 for key, val in kv\gmatch '([a-z]-)%s*=%s*(%d+)'
69 info[key] = val
710
811 title = () =>
1619 format_full = () =>
1720 tt = title @
1821 dot, com = if @title\match '[.?!]$' then '', '' else '.', ','
22
23 -- @author = deandify @author if @author
24 -- @editor = deandify @editor if @editor
25
1926 switch @_type
2027 when 'book', 'article'
2128 span with setmetatable {}, __index: table
4350 {
4451 converts: {
4552 {
46 inp: 'URL -> cite/acm'
53 inp: 'cite/doi'
4754 out: 'URL -> text/bibtex'
48 cost: 0.5
49 transform: (url) =>
50 id = assert (url\match '//dl%.acm%.org/citation%.cfm%?id=(%d+)'), "couldn't parse cite/acm URL: '#{url}'"
51 uri = "https://dl.acm.org/downformats.cfm?id=#{id}&parent_id=&expformat=bibtex"
52 if MODE == 'CLIENT'
53 "https://cors-anywhere.herokuapp.com/#{uri}"
54 else
55 uri
55 cost: 0.1
56 transform: (doi) =>
57 doi = doi\match '(10%.%d%d%d%d%d?%d?%d?%d?%d?/[%d%w%.%-_:;%(%)]+)'
58 "http://api.crossref.org/works/#{doi}/transform/application/x-bibtex"
5659 }
5760 {
5861 inp: 'text/bibtex'
209209 cost: 2
210210 transform: single code
211211 }
212 -- this one needs a higher cost
213 -- {
214 -- inp: 'URL -> .+',
215 -- out: 'mmm/dom',
216 -- transform: single code
217 -- }
218212 {
219213 inp: 'URL -> (.+)',
220214 out: '%1',
+0
-1
root/articles/mmmfs/references/subtext/URL -> cite$acm less more
0 https://dl.acm.org/citation.cfm?id=1094851
0 @article{10.1145/1103845.1094851,
1 author = {Edwards, Jonathan},
2 title = {Subtext: Uncovering the Simplicity of Programming},
3 year = {2005},
4 issue_date = {October 2005},
5 publisher = {Association for Computing Machinery},
6 address = {New York, NY, USA},
7 volume = {40},
8 number = {10},
9 issn = {0362-1340},
10 url = {https://doi.org/10.1145/1103845.1094851},
11 doi = {10.1145/1103845.1094851},
12 journal = {SIGPLAN Not.},
13 month = oct,
14 pages = {505–518},
15 numpages = {14},
16 keywords = {copying, non-textual programming, prototypes, visual programming},
17 }
+0
-1
root/articles/mmmfs/references/unix/URL -> cite$acm less more
0 https://dl.acm.org/citation.cfm?id=577766
0 @book{10.5555/577766,
1 author = {Kernighan, Brian W. and Pike, Rob},
2 title = {The UNIX Programming Environment},
3 year = {1983},
4 isbn = {0139376992},
5 publisher = {Prentice Hall Professional Technical Reference}
6 }
+0
-1
root/articles/mmmfs/references/xerox-star/URL -> cite$acm less more
0 https://dl.acm.org/citation.cfm?id=66894
0 @article{xerox:star,
1 author = {Johnson, Jeff et. al},
2 title = {The Xerox Star: A Retrospective},
3 journal = {Computer},
4 issue_date = {September 1989},
5 volume = {22},
6 number = {9},
7 month = sep,
8 year = {1989},
9 issn = {0018-9162},
10 pages = {11-26, 28-29},
11 url = {http://dx.doi.org/10.1109/2.35211},
12 doi = {10.1109/2.35211},
13 acmid = {66894},
14 publisher = {IEEE Computer Society Press},
15 address = {Los Alamitos, CA, USA},
0 @article{10.1109/2.35211,
1 oldauthor = {Johnson, Jeff and Roberts, Teresa L. and Verplank, William and Smith, David C. and Irby, Charles H. and Beard, Marian and Mackey, Kevin},
2 author = {Johnson, Jeff et al.},
3 title = {The Xerox Star: A Retrospective},
4 year = {1989},
5 issue_date = {September 1989},
6 publisher = {IEEE Computer Society Press},
7 address = {Washington, DC, USA},
8 volume = {22},
9 number = {9},
10 issn = {0018-9162},
11 url = {https://doi.org/10.1109/2.35211},
12 doi = {10.1109/2.35211},
13 journal = {Computer},
14 month = sep,
15 pages = {11–26, 28–29},
16 numpages = {1},
1617 }