Giter Site home page Giter Site logo

Comments (10)

micha06de avatar micha06de commented on August 21, 2024 1

Or actually better, add a default.yaml file in the PanWriter User Data Directory, then you can keep the format and it will be previewed correctly. See the PanWriter Manaul

Good tip, I tried it and it works! Thank you very much!

from panwriter.

mb21 avatar mb21 commented on August 21, 2024

Can you provide a minimal reproducible example of a markdown document that doesn't work?

from panwriter.

micha06de avatar micha06de commented on August 21, 2024

Below is the markdown.
In Firefox, the links are not displayed in light blue because they are overwritten by the default CSS (there are two <style> sections in the HTML). The one from Panwriter has been overwritten.

---
title: Test formating in Panwriter
mainfont: Helvetica, Arial, sans-serif
header-includes: |-
  <style>
   h1, h2, h3, h4, h5, h6 {
      margin: 20px 0 10px;
      padding: 0;
      font-weight: bold;
      -webkit-font-smoothing: antialiased;
    }

    h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
      font-size: inherit;
    }

    h1 {
      font-size: 24px;
      color: #000;
    }

    h2 {
      font-size: 20px;
      border-bottom: 1px solid #ccc;
      color: #000;
    }

    h3 {
      font-size: 18px;
    }

    /* LINKS */

    a {
      color: #4183C4;
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
    }
  </style>
---
# Links Beispiele
- [Google](https://www.google.com)  
- [GitHub Panwriter ](https://github.com/mb21/panwriter)

from panwriter.

mb21 avatar mb21 commented on August 21, 2024

How do you generate the HTML? With File -> Save as or Export ?

they are overwritten by the default CSS (there are two <style> sections in the HTML)

overwritten by which default CSS? from panwriter or pandoc?

In the other issue you wrote:

there should not be an embedded style section in the YAML area of the Markdown, as this overwrites the definitions from default.yaml.

I'm confused. which do you expect to take precedence?

from panwriter.

micha06de avatar micha06de commented on August 21, 2024

Sorry for the late response, I was away for a few days.

How do you generate the HTML? With File -> Save as or Export ?

With export.

overwritten by which default CSS? from panwriter or pandoc?

Neither, in the generated HTML there are two style sections one below the other, with partly contradictory definitions for the elements, which different browsers probably interpret differently.

It would be better if there was a CSS template that the user could customize as desired, so that the HTML only contains one style section. This is what MarkdownPad does, for example.

from panwriter.

mb21 avatar mb21 commented on August 21, 2024

Okay, now I understand.

which different browsers probably interpret differently.

No, nowadays all browsers behave exactly the same in regards to such basic things.

In Firefox, the links are not displayed in light blue

That's because in your browser you have visited those links, so the a:visited color applies.

Now, where the two style sections come from. The second is your CSS from the markdown document, the first style is the document-css from pandoc's own template. You can turn it off by adding the following to your markdown document's metadata:

document-css: false

But the idea of this feature was actually that you would only override a few document-specific styles. If you want to change everything, it's probably better to add a ~/Library/Application Support/PanWriterUserData/default.yaml (or ~/.pandoc/templates/styles.html) file so that it applies to all your documents.

from panwriter.

micha06de avatar micha06de commented on August 21, 2024

But the idea of this feature was actually that you would only override a few document-specific styles. If you want to change everything, it's probably better to add a ~/.pandoc/templates/styles.html file so that it applies to all your documents.

Now I just need to know how the styles.html must be composed ...

from panwriter.

mb21 avatar mb21 commented on August 21, 2024

Or actually better, add a default.yaml file in the PanWriter User Data Directory, then you can keep the format and it will be previewed correctly. See the PanWriter Manaul

from panwriter.

micha06de avatar micha06de commented on August 21, 2024

How do you generate the HTML? With File -> Save as or Export ?

Hmm, I have just noticed that only .md is available for selection under 'Save as'. Should .html also be available here?

from panwriter.

mb21 avatar mb21 commented on August 21, 2024

Hmm, I have just noticed that only .md is available for selection under 'Save as'. Should .html also be available here?

No, .md is just saving the exact text you currently have in the PanWriter editor while .html actually needs an export by running it through pandoc.

from panwriter.

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.