On 12/31/2017 01:59 PM, Lee wrote:
On 12/31/17, Richard Owlett <rowl...@cloud85.net> wrote:
[SNIP]

I had in mind:
  1. Save the bookmarks.
  2. Pretty print the JSON to a file.
  3. Edit the "pretty file" - awkward but doable.
  4. "Uglify" {if required} to have syntactically correct JSON.
  5. Replace the current set of bookmarks using "Restore" function.


Other people have worked on related tools.
Searching planet.mozilla.org and mozillazine.org has been productive.
In fact the second article on planet.mozilla.org {Templating
JSON/YAML with json-e} suggests some aspects of json-e would be
applicable to my problem.

I am also searching Debian repositories. Packages related to "aeson"
appear promising.

have you come across 'jq' yet?

About 15 minutes ago <*ROFL*> !!!!
http://discoposse.com/2016/09/13/using-jq-to-pretty-print-json-output/ gives a pretty picture of it doing *EXACTLY* what I was looking for. :}


   eg: to prettyprint json:
$ jq . bookmarks-2017-12-31.json |more
{
  "guid": "root________",
  "title": "",
  "index": 0,
  "dateAdded": 1496405759960000,
  "lastModified": 1514747427222000,
  "id": 1,
  "type": "text/x-moz-place-container",
  "root": "placesRoot",
  "children": [
    {
      "guid": "menu________",
      "title": "Bookmarks Menu",
  <.. snip ..>

which looks like a pain to manually edit.

Had I not said
  "3. Edit the "pretty file" - awkward but doable."
<chuckle>

It gives me a visual aid for doing copy-n-paste.



What was your initial test with export as html?  I've done export as
html, edit the file, delete all bookmarks, import the edited html &
not noticed any problems.  What did you see?

It did not preserve the nesting structure. My folders are nested up to 3 deep.

I had already created some small but perverse sample bookmarks sets.

Thank you!


Regards
Lee


_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to