Code Monkey home page Code Monkey logo

Comments (5)

weitzman avatar weitzman commented on August 26, 2024 1

Finally figured out how to send the selected HTML to the same web service. I prefer this to introducing new converters for now.

I reran difficode and all the new markdown is in the diffi repo. At first glance, it looks like a big improvement.

Closing this issue. We can open more as needed.

Thanks again for your help here, @lynnyliz.

from difficode.

weitzman avatar weitzman commented on August 26, 2024

Initial implementation done but I would prefer top send HTML there instead of sending an URL. Had lots of trouble with POSTING to marky - missing form fields.

from difficode.

quin-jay avatar quin-jay commented on August 26, 2024

Another potential strategy: What if we changed the selectors from "body" to whatever that particular webpage uses to contain its actual policy text? For example, in the Snapchat TOS the policy is contained in a <div class="column">.

Pros:
-Could select much more specific areas of the page, leaving off changes to head code or footer URLS
-Some websites might even have an id attribute on the div containing their policies! 😮

Cons:
-More work required per added page
-Some pages will probably still have messy HTML resulting in noisy diffs
-Possibly the JSON recipes don't even support specifying classes? I don't have much experience with this kind of setup.

EDIT: Poking around more I see there are already some sites that use an ID (good ol' Google) and that you sure can specify an ID or class selector, so now I've found stuff I can contribute 😃

from difficode.

quin-jay avatar quin-jay commented on August 26, 2024

@weitzman I found another tool that converts inputted HTML to markdown, but I'm not sure what diffibot's capabilities are -- this requires pasting HTML into one text field and then copying the output from another (there's no file export)

But this one may be exactly what we need -- It's a python script that seems able to do the conversion by both importing and exporting relevant files. Looks like you'll be able to feed it a privacy.selected.html and export markdown into privacy.md

from difficode.

quin-jay avatar quin-jay commented on August 26, 2024

@weitzman I think I found a winner: html.md is a node.js library that allows importing a .html file and exporting as .md. I think the command would run like this: htmlmd *.selected.html. Alas, I don't think there's an option to recursively run it through all subfolders, so we may need to run it in each recipe's respective dir.

Other options that work with node.js are domchristie's To-Markdown and netgusto's upndown, though these seem to only take strings as input.

from difficode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.