Giter Site home page Giter Site logo

mb21 / panwriter Goto Github PK

View Code? Open in Web Editor NEW
1.0K 21.0 45.0 4.7 MB

Markdown editor with pandoc integration and paginated preview.

Home Page: https://PanWriter.com

License: GNU General Public License v3.0

HTML 0.88% CSS 24.75% TypeScript 74.38%
pandoc pandoc-ui electron react editor markdown-editor markdown-converter markdown

panwriter's Introduction

PanWriter

PanWriter is a distraction-free markdown editor with two unique features:

  1. Tight integration with pandoc for import/export to/from plenty of file formats (including HTML, docx, LaTeX and EPUB).
  2. Preview pane that can show pages – including page breaks etc. Layout adjustments are immediately reflected in the preview.

Read the MANUAL for more info.

Download PanWriter

You also have to install pandoc to export to most formats.

Feedback, suggestions and contributions very much welcome! Please open an issue to start a conversation.

Develop

Install git (if you haven't already) and install Volta (which will make the correct Node.js and npm versions availlable in the project directory), then:

git clone [email protected]:mb21/panwriter.git
cd panwriter
npm ci

## To run the app in development mode:
npm run electron:dev

## To build distributable app package (goes to ./dist):
npm dist

Check out the package.json for more scripts to run.

Powered by

PanWriter is powered by (amongst other open source libraries):

panwriter's People

Contributors

dependabot[bot] avatar evandandrea avatar jan-zajic avatar mb21 avatar skeeve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

panwriter's Issues

Load webfont in paginated view

Hi
How are we suppose to load webfonts.

In the css file, I have @font-face rule

@font-face { font-family: 'Ink';
 src: url('./webfonts/InknutAntiqua-Regular.eot'), /*IE9CompatibilityModes*/ 
 url('./webfonts/InknutAntiqua-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 
 url('./webfonts/InknutAntiqua-Regular.woff') format('woff'), /* Navigateurs modernes */
 url('./webfonts/InknutAntiqua-Regular.ttf') format('truetype'); /* Safari, Android, iOS */
 }

It works in the markdown preview but failed in the pagejs preview.

I saw #5 and I think the issue is similar. The <base href=""> is set as I can see it in developper tools but the font doesn't load as panwriter seems to look for them from the folder of the app and not from the document folder.
It is trying to load it from
file:///Applications/PanWriter.app/Contents/Resources/app.asar/static/webfonts/InknutAntiqua-Regular.ttf

Best regards.
And thanks for Panwriter and your help.

Failed to export error (font issue?)

When I try to export a file, I get the following error message:

Failed to export
Called: pandoc --metadata 'mainfont=-apple-system, BlinkMacSystemFont, Segoe UI, sans serif' --metadata monobackgroundcolor=#f0f0f0 --output /home/[user name]/Documents/-[file name] --to --standalone

I experienced this issue while trying multiple files: 1) the "Install and Use Pandoc.md" file (included in the Pandoc download) and 2) a file I made that just has the word "test" in it. I also experienced this while trying to export to multiple file types (ODT and PDF).

I'm running the latest version (0.8.0) on Ubuntu 21.04. I have Pandoc installed and just confirmed I'm able to use it via the command line (I successfully exported a markdown file to HTML).

Apologies if I'm missing something and thank you for actively developing a more user-friendly GUI for Pandoc!

Feature request: rendering of tables

Hi, I've only used this program for about 30 minutes and I don't use github very often, so sorry if I'm posting this in the wrong place or something. Anyway, I noticed that the document preview doesn't correctly display any tables other than regular pipe tables. Is this going to be fixed? Thanks!

all table styles other than regular pipe tables don't work

Potential Windows/Linux builds

Hi there, this looks a great project. Seeing as it's electron based, is there a chance you'll release Linux and Windows builds?

Editing CSS makes text disappear

On Windows 10:

  1. Create some text
  2. Click Add CSS Style
  3. Make any change to CSS
  4. Text disappears in preview.

Even if you change the CSS back to it's original state, the preview will not generate.

Windows installer file type association problematic

Windows installer:
User cannot opt-out file type association.
File type association in Windows registry is problematic.
After installing panwriter from installer,
Explorer -> Right Click -> New -> Text Document is removed because some registry values are wrong.

I want to opt-out file type association.

License vs CLA

Eventually, I would like to distribute PanWriter in one of the app stores as well, or at least keep the door open to do so. Since the GPL and for example the Apple App Store are incompatible, there seem to be these options.

  • keep the code GPLv3 but also get a Contributor License Agreement (CLA) from each contributor, using e.g. https://cla-assistant.io. Not sure what exactly the agreement would have to say... the FSF e.g. requires copyright transfer for their project. (CLAs is also what e.g. Signal-iOS and many larger organizations do.)

  • switch to the Mozilla Public License (that's apparently what VLC does)

    The MPL is a simple copyleft license. The MPL's "file-level" copyleft is designed to encourage contributors to share modifications they make to your code, while still allowing them to combine your code with code under other licenses (open or proprietary) with minimal restrictions.

  • switch to a BSD-style copyleft-free license, like the MIT license. This makes it even easier for someone to distribute a clone of the app in an app store, which may or may not have been altered, charge for it, etc. – all without contributing back to the community.

Interesting blog post discussing some trade-offs.

Feedback welcome!

Dark Theme desirable

I think that a Dark Theme will not be a distracting feature and, to me at least, it's much more convenien for long time working.
Thanks for this usefull editor!
Rafael

Lost CSS preview rendering

Hello and thanks for this beautiful piece of software. I’m using it for my documents and I like the idea to keep content and styling separated.
But from version 0.8.0 my files with a yaml header that recalls a css file are not working anymore.
Example:
My yaml header is something like this:

---
type: doc
---

Then I have a css file called doc.css in the PanWriterUserData folder which applies the style rules for the document in the preview.
From version 0.8.0 this is not working. I’m running Panwriter on a MacBook with Big Sur OS.
By the way, I downgraded to version 0.7.2 but it keeps to automatically update to 0.8.0 every time I launch the app. Anyone can tell how to prevent it from updating?
Thanks a lot!

Exporting to ePub repeats the title

Hi,

As you can see in this epub: https://t2188684.p.clickup-attachments.com/t2188684/15afd1f9-3f10-491c-a072-c73e4d3aac89/bigger-leaner-stronger-summary-storyshots.epub the title is repeated twice. Why is that?

This is the markup:

---
title: 'Summary of Bigger Leaner Stronger by Michael Mathews '
author: StoryShots - Free Book Summaries and More
---


## Synopsis

[Bigger Leaner Stronger: The Simple Science of Building the Ultimate Male Body](https://geni.us/bigger-free-audiobook) focuses on the best tips for building muscle and losing fat. Michael Matthews gives you a blueprint for how you can start eating and exercising your way towards a bigger, leaner, and stronger body. He claims this book should offer the advice required to gain 10 to 15 pounds of lean mass in only 8-12 weeks.

Make PDF searchable and convert headings to bookmarks

Printing to PDF for some reason converts them as a scan without searchable functions nor bookmarks. Would be nice to have them convert with these features (like it does exporting to pdflatex).

Thanks for your awesome work!

Error with AppImage distribution and 0.6.3

When running appimage distribution in debian buster, the following error is displayed:

[26367:0516/194739.179205:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_panwrip9eVNH/chrome-sandbox is owned by root and has mode 4755.
zsh: trace trap ./panwriter-0.6.3-x86_64.AppImage

The 0.6.2 AppImage file works.

yaml header has no effect

putting this in front of a document doesn't alter anything;

---
title: logwrapper
style: |
  @page {
    size: A4;
    margin-top: 2cm;
  }
  h1 {
    color: purple;
  }
  p {
    font-size: 1.1em;
  }
---

I'd expected at least a changed h1-Header color....

Dark theme on macOs Big Sur

I don't quite know why, but in macOs Dark mode PanWriter looks Horrible:

  1. Something breaks in highlighting
  2. When it automatically switches from Light mode to Dark mode, you have to restart pan writer, otherwise opened preview field is kinda tinted/faded (couldn't catch the moment, so can't exactly repro, except wait for another sundown)

Probably, there's a neat fix I just can't find, but, since there is no 'Preferences' pane in the app I'm finding it hard to fix it on my own.
The app could benefit from some sort of 'Preferences', like highlight colour options for dark/light mode.
Screenshot 2021-03-21 at 19 17 45

Using macOS Big Sur 11.2.2 and PanWriter 0.7.2

Suggestion: Open files in preview mode

When i open my notes I usually want to view it in its rendered form, and I find it slightly annoying to have to click on the eye icon everytime.

Would've done a pull request but I don't know any purescript. Maybe I'll do it on the ts branch

Render HTML in Markdown Preview

From what I can tell, PanWriter uses the following package to provide the preview pane to markdown files.

https://github.com/markdown-it/markdown-it#markdown-it

There is an option that can be toggled to true that allows HTML to be rendered.

Perhaps we could have a settings dialog to manage some of the default properties?

The latest version, running on Mac, doesn't seem to support it.

Here is my markdown:

image

The preview:

image

User data directory location

Hi and thanks for this pandoc editor. I'm hoping to recommend it for a new project. I would be planing to use this as a tool for previewing, but not rendering, which would take place on a CI server. I notice that it's possible to set default.yml in a so called user data directory. But what I'd really want, is to have a configuration set from the same location, that way the respository we'd be working with would be self contained and every contributor would be editing the same .css files using the same configuration. Would it be possible for panwriter to read configuration files from the same directory as the source file? In the end, relative paths to .css files is what I'm mostly after, and since we have so many files, it wouldn't make sense to copy paste the styles into the metadata section of each file.

Idea for preview: use pandoc compiled to wasm instead of markdown-it.js

Got this idea when seeing asterius, they even have a pandoc demo: https://github.com/tweag/asterius/blob/master/README.md#demos

but not sure about the performance, ease of maintainability etc.

Edit: alternatively, we could try:

Snap on the snap store

Hi,

Can you post the snap on the snap store, so that we have automatic updates ?

Please, asking for a friend ;)

Best Regards

Respect @Page size declaration

Panwriter doesn't seems to respect the size delcared in YAML frontmatter.
Telling

@page {
    size: A5 portrait;
  }

or even with 148mm 210mm
doesn't work.

It works in User Data file but not directly in the file itlself

support $$...$$ math mode

Hi, I just test the latest Windows release PanWriter.Setup.0.5.4.exe, it support inline math mode, that is:
$a+b$, but it failed in $$a+b$$ which is another math mode(display the formula in a separate line), can you support it? Thanks.

Can not export

Issue

When exporting a .md file (for e.g., to word .docx), nothing happens.

Console shows this. When browsing the Roaming folder, PanWriterUserData folder does not exist.

md file used.

Is there something I am doing wrong? Thanks!

Other Info

System: Windows 10 Enterprise 2016 LTSB
PanWrite Version: 0.7.2.0 ("Only for me")

preview window can't show the local image

Hi, if I have a file named "text.md", and a file "a.png" is put in the same folder of this markdown.

![a](a.png)

This code does not show the image in the preview window, can you enable this? I think the local image(usually they have relative path to the md file) should be shown correctly.

Thanks.

Mac OSX Catalina security

On Mac OSX Catalina 0.6.5 needs permission to be run. A message similar to:
App can’t be opened because Apple can’t check it for malicious software is seen. Only administrators of the Mac can allow the app to run.

preview pages

Hello, I am very interested with the pages preview feature and I tried the example 

---
title: my document
style :
@page {
size: A4;
margin-top : 2cm;
}
---

but it only shows the code.
2020-05-05_11h54_51

Option for pre-processor (feature request)

Really looking forward to seeing PanWriter develop!

Not sure if it's a bit late in the day but the option to pass source text through a pre-processor such as pp or gpp (for preview?export?both?) would be great.

Many thanks!

McAfee considers this a virus

McAfee considers PanWriter (windows, version 0.6.4) a virus
It's extremely odd. The virus name is just

Real Protect-EC!BF1FD2B77F4C

How to build from source

Dear Developper,
Thanks for panwriter, which is already a great tool.

The giving procedure :
git clone [email protected]:mb21/panwriter.git
cd panwriter
yarn install

Does not work out the box :
git clone https://github.com/mb21/panwriter --> modified URL
cd panwriter
yarn install ---> 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'

Can you update the procedure so that a newbie can build ;-)

ChromeOS support

congratulations, panwriter 0.8.0 is great.

I like to use it on a Chromebook and it compiles fine, but does not have support to call pandoc

it seems when issuing yarn install the current version looks for darwin / osx / apple versions of fsevents and a few other packages (unsupported platform warnings) and does not realize that the container is a Linux environment

the appimage gets built and can be started (on an arm64 Chromebook), supercool. just the export using pandoc is not working.

Snapcraft: Circle CI build fail

On snap package publishing

Pushing panwriter_0.6.3_amd64.snap
After pushing, an attempt will be made to release to 'stable'
Using local configuration ('.snapcraft/snapcraft.cfg'), changes will not be persisted.
Preparing to push '/root/project/dist/panwriter_0.6.3_amd64.snap' to the store.
Received 401: '{"error_list": [{"code": "macaroon-authorization-required", "extra": {"realm": "Devportal"}, "message": "The request is missing an Authorization header field containing a valid macaroon"}]}'

Exited with code exit status 2

Windows install folder choose

Hi, when I run the Windows installer, it just install the software, and I don't know where it is installed, this is not quite user friendly, can you show at least a dialog to let the user choose the installed folder?

Export fails with pandoc error

Version: 0.6.3 (AppImage)
Pandoc: 2.5

The error:

Failed to Export
Called: pandoc --output /tmp/pandoc-test --to --standalone

Steps to reproduce:

  1. Open PanWriter
  2. Open Markdown document
  3. File -> Export
  4. Export

Open Recent menu doesn't show recent documents

Version: 0.6.3 (AppImage)

The File -> Open Recent menu doesn't show after the application is restarted.

Steps to reproduce:

  1. Open PanWriter
  2. Open a Markdown file
  3. Close PanWriter
  4. Re-open PanWriter

Improve editor accesibility with screen readers

Hello!
Pandoc is very useful for blind people, since it generates accessible documents using HTML, docx, epub output, among others, excluding PDF.
This application has a very big potential, especially for those who do not handle the command line. However, the editor is not accessible with screen readers. All the rest, including the buttons and the menu bar reads very well, since everything is correctly labeled.
To fix this I suggest using the Monaco Editor, which provides many accessibility options.
thanks!

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.