Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthoraef110
    • CommentTimeJul 26th 2011
     
    I have a little idea for importing HTML into Ulysses: Hyperlinks could automatically be formatted, e.g.:

    <a href="http://www.mywebsite.com">My link text</a>

    ... would become:

    [[1-http://www.mywebsite.com]] in the notes pane and:

    [[1-My link text]] in the editor window. (Tags could simply be numbered consecutively, skipping a number if a document already contains that tag.)

    Would such a script be of use to other users? It would also be possible to import more HTML tags, translating <strong> to **, etc., but such transformations are already possible using search and replace.


    Kind regards,

    Albert
    •  
      CommentAuthorfbrault
    • CommentTimeJul 27th 2011
     
    Hi Albert,

    Well, could such a script also take an image link such as:

    <img src="images/example/IMAGMassModel.jpg" title="Fig. 1 Completed Massing Model" />

    and make it

    [[1]] in the editor window, and [[1-«imageData»- Completed Massing Model]] in the document notes pane?

    I would certainly use such a tool, since I have to enter hundreds of images in 2 places for each document.

    I haven't figured out how to direct input to specifically to the editor window, or say, to a new document notes pane.

    Regards,

    Frank Brault
    •  
      CommentAuthoraef110
    • CommentTimeJul 27th 2011
     
    Hi Frank,

    Exactly. What I'm thinking is that there could be an HTML import module. I ended up writing a Python script to translate pages on my site from my pre-Ulysses days, but the links and images I had to do by hand. It was possible to create some shortcuts since it's simple text processing, but I did have to cut and paste each link and image into the notes pane by hand.

    Not everything would be translated. Ulysses currently doesn't support features such as tables, though this will no doubt change with 3.0 (or 2.1?).

    One simple change that would be very useful for websites would be the use of project notes for hyperlinks. Links are recycled over and over again throughout a large website, and it would be nice not to have to type them in for each document. Maybe I'm getting ahead of myself here, but it is something that's been mentioned before.

    Anyway, I (as but a hobby programmer) could write a basic HTML importer pretty easily in Python. I'll bet the wizards at the Soulmen could come up with something spectacular!


    Best,

    Albert
    •  
      CommentAuthorfbrault
    • CommentTimeJul 29th 2011 edited
     
    There are instances when such a tool would save me a lot of time.

    For me, the images are largely a manual affair. I haven't looked at the note structure inside the file package. Maybe I could create a hundred notes and then make an automator file that would place an incrementing UID text string and one image into each of the document note files.

    In your experience Albert, is there a practical limit to the number of images that a document can contain? I am getting upwards of 150 3-5 MB images and I am wondering if I will encounter issues eventually.

    I am working on an xml export template, but I must create an action for every Style that I use in the Ulysses project. This works for my current project, but the template is not dynamic in the sense of generating the current styles nor generalized, and so I will make a new template for every project. This only happens once per project.

    Thanks,

    Frank Brault
    •  
      CommentAuthorgoetz
    • CommentTimeJul 30th 2011
     
    Hello Albert and Frank,

    in my opinion, the issue with creating such an importer is that each webpage has a certain structure, and people are using different kinds of tags. For instance, one may be using the alt tag of an image, another one is using the title tag, and so on. Additionally, the placeholders in Style Actions of the WebExport are very flexible. By default, the Image action has the following Note format: {{key}}-{{image.data}}-{{description}}. What if the format would be different? (e.g., with an added alt tag placeholder?) What if there are multiple Image actions (one for small images inside the text and one for large images between paragraphs)? Writing a customized Python script which parses the HTML files to be imported would be much simpler.

    By the way, Ulysses has an open Project format, that means you can simply Ctrl-click your Project file, and select "Show Package Contents" to see what a project looks like from the inside. Each Document has a folder, and each document has one or more Notes files (stored in Rich Text Format). Be sure to back up your Project before modifying its file contents ;)

    Cheers, Götz
    •  
      CommentAuthoraef110
    • CommentTimeAug 10th 2011
     
    Hello Götz,

    You wrote: "Writing a customized Python script which parses the HTML files to be imported would be much simpler."

    That's what I did to import my website to Ulysses. There was still manual work to be done, such as formatting hyperlinks as notes, but I probably could have programmed the script to modify the Ulysses project file directly had I played with it long enough. (Sometimes it's still more efficient to do a task by hand!)

    I couldn't be happier now that my website "lives" in Ulysses. It makes managing and updating the site and finding keyword references, etc., incredibly fast and easy.


    Kind regards,

    Albert