daviddias / awesome-hacking-locations

:computer: :coffee: List of Awesome Hacking Locations, organised by Country and City, listing if it features power and wifi
MIT License
1.06k stars 150 forks source link

Parsing Awesome-Hacking-Spots markdown? #143

Open Alex-Keyes opened 6 years ago

Alex-Keyes commented 6 years ago

Do you guys have suggestions for coming with a good way to parse through this document? I don't want to change the format of anything since that means we won't be able to have new PRs updated in the document. I was wondering if anyone could recommend a way to proactively parse through the README

RichardLitt commented 6 years ago

Can you specify the requirements a bit more? wooorm/remark is one of the better markdown parsers out there, which may work for this, but there's a bit of a learning curve.

Alex-Keyes commented 6 years ago

So I was thinking that we'd need to have a parser that could search by either city or country that would return a list of the locations under that subheading. I am thinking a simple text search for Matching the search with a name of a location on the document would be good.

On Dec 4, 2017 09:58, "Richard Littauer" notifications@github.com wrote:

Can you specify the requirements a bit more? wooorm/remark https://github.com/wooorm/remark is one of the better markdown parsers out there, which may work for this, but there's a bit of a learning curve.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/diasdavid/awesome-hacking-spots/issues/143#issuecomment-348986516, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKQFrCAxV0xYJNR-q-o273AQZJqbpyRks5s9AiRgaJpZM4Qz_WK .

RichardLitt commented 6 years ago

How does this improve on the browser's native search?

Alex-Keyes commented 6 years ago

It doesn't. I wanted to build a frontend for our readme list. Something like the Homebrew cask website. I'm asking about the best way to implement the functionality of the search page on that site. It uses the GitHub API and parses through the tree of committed files for packages. Obviously we can't do that since we have one big file so I was looking for suggestions on the best way to search our big markdown file.

On Dec 4, 2017 10:04, "Richard Littauer" notifications@github.com wrote:

How does this improve on the browser's native search?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/diasdavid/awesome-hacking-spots/issues/143#issuecomment-348988384, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKQFnWY923TW2gIyQXf8-o-NBZoqAjxks5s9An9gaJpZM4Qz_WK .

RichardLitt commented 6 years ago

It looks like it should be trivial to implement their search directly. You can use basic regexes to search for cities with headings in the regex - ## Bogota, for instance, or just use plain text and see if our mileage varies.

Might be worth setting up a second GitHub repo for this, too. You could also use some GitHub database workflow, like opensourcedesign does, or octonews (unreleased, more work to do) will.

Alex-Keyes commented 6 years ago

FWIW I've already set up a second branch on my local version of the repo. IIRC Github pages can work for either a separate branch or a separate repo. Thanks for the advice I was thinking that a plaintext regex search of the document is probably the best way to go but I like having someone to bounce ideas off of, you know?

On Mon, Dec 4, 2017 at 10:20 AM, Richard Littauer notifications@github.com wrote:

It looks like it should be trivial to implement their search directly https://github.com/caskroom/caskroom.github.io/blob/master/js/search.js. You can use basic regexes to search for cities with headings in the regex - ## Bogota, for instance, or just use plain text and see if our mileage varies.

Might be worth setting up a second GitHub repo for this, too. You could also use some GitHub database workflow, like opensourcedesign https://github.com/opensourcedesign/opensourcedesign.github.io does, or octonews https://github.com/octonews/octonews (unreleased, more work to do) will.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/diasdavid/awesome-hacking-spots/issues/143#issuecomment-348993208, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKQFkTHEGq4LSWUibKLl_s-9M4LJFALks5s9A2ngaJpZM4Qz_WK .

-- Alex Keyes Phone: 203 240 2168 Calendar: https://alexkeyes.youcanbook.me www.alexkey.es