bitjson / s18n

Semantic localization for html.
MIT License
23 stars 10 forks source link

CLI extract doesn't return anything #6

Closed kaicarver closed 8 years ago

kaicarver commented 8 years ago

s18 extract doesn't seem to find any html files in the directory.

kai@bluesteel ~/github/web
$ ls *.html
index.html

kai@bluesteel ~/github/web
$ s18n extract

kai@bluesteel ~/github/web
$ 

A workaround is to pass a file in as a string via some command-line magic...

kai@bluesteel ~/github/web
$ s18n extract -s "$(cat index.html)" | head -5
{ '43334488': '<ul>\n<li><a href="http://yowureport.com/?p=6498">Yowureport - Hackerspaces & Makerspaces</a></li>\n<li><a href="/AssociationAnnouncement.jpg">Association announcement in 都會時報 (2014/08/01)</a></li>\n</ul>\n\n\n<div class="page-header" id="sponsors">\n  <h1>Supporters of the Taipei Hackerspace</h1>\n</div>',
  '48292469': '圓環(南京) (to East)',
  '66376152': 'Github Organization / Repository',
  '01af1289': '+886-2-2550-7630',
  c20ad4d7: '12',

kai@bluesteel ~/github/web
$

Then as seen above I have a problem getting it to recognize li and div elements, but that would be another issue... (It doesn't help at all to specify elements via a command line parameter like -e 'title,p,h1,h2,h3,h4,h5,h6,ul,li,a,div')

HTML file is here: https://github.com/taipeihackerspace/web/blob/master/index.html

Should I not be trying to use the CLI at all?... I'm confused...

bitjson commented 8 years ago

Hey @kaicarver, thanks for the bug report! That CLI method was using the old s18n.extractFiles() interface, which was silently breaking. The new release is on npm and here: https://github.com/bitjson/s18n/releases/tag/v2.0.1

Please let me know if you notice any other issues.

kaicarver commented 8 years ago

thank you, CLI extract works better now. And so I'll post a couple more issues then, sorry :)