Coder Social home page Coder Social logo

wootom's People

Contributors

davidstraka2 avatar kalvotom avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kalvotom

wootom's Issues

Add HTML preview

Preview HTML document to the side of the editor.

The HTML source should be passed using API, not the currently opened document. This makes the currently existing packages implementing HTML preview probably unusable, so a custom implementation will be needed.

Add syntax highlighting

Add simple, template independent WooWoo syntax highlighting.

(This will be expanded on in the future by adding dynamic template-aware syntax highlighting.)

Broken TikZ SVGs on macOS

The SVG images in the preview of the !tikz outer environments are broken on macOS. Only the text is shown, all of it aligned to the top of the image, no other shapes are displayed. See an image example below.

tikz-svg-error

Compare that to the correctly displayed SVG on Windows 10 and Arch Linux, shown below.

tikz-svg-correct

The WooWoo source of the .Figure object from the examples shown is included below. Note that the preview examples use dark editor theme and inverted SVG colors.

.Figure:
  label: fig-vektory

  !tikz:
    filename: fig-vektory-1

    \draw[blue,thick,->] (0,0) -- (3,3) node[anchor=south east] {$\alpha \cdot \vec a,\, \alpha > 1$};
    \draw[very thick,black,->] (0,0) -- (2,2) node[anchor=north west] {$\vec a$};
    \draw[red,very thick,->] (0,0) -- (1,1) node[anchor=south east] {$\alpha \cdot \vec a,\, 0 < \alpha < 1$};
    \draw[brown,thick,->] (0,0) -- (-1,-1) node[anchor=north west] {$\alpha \cdot \vec a,\, \alpha < 0$};
    \fill[black] (0,0) circle (2pt) node[anchor=south east] {$O$};
    \node at (1,-2) {(a)};

  !tikz:
    filename: fog-vektory-2
    options: 'scale=1.5'

    \draw[black,thick,->] (0,0) -- (.5,2) node[above] {$\vec a$};
    \draw[blue,thick,->] (0,0) -- (1.5,-.5) node[below] {$\vec b$};
    \draw[blue,dashed] (.5,2) -- (2,1.5);
    \draw[black,dashed] (1.5,-.5) -- (2,1.5);
    \draw[red,very thick,->] (0,0) -- (2,1.5) node[anchor=south west] {$\vec a + \vec b$};
    \node at (1,-1.5) {(b)};
    \fill[black] (0,0) circle (1pt) node[left] {$O$};

  .caption:

    Geometrický význam násobení vektoru číslem (a) a sčítání vektorů (b).

The TeX file used for generating the SVG, the DVI file generated from it on macOS using latex (from an up to date MacTeX distribution), the log file from the process, as well as both the broken SVG generated on macOS and correct SVG generated on Windows 10 - both using dvisvgm included in the TeX distribution (that being full texlive on Windows) - can all be found attached in this zip archive attachment.

Update project description

Update project description to reflect currently present features. Add development setup instructions. Tweak settings' descriptions.

Add WooWoo HTML preview support for the `only` metablock item

Add WooWoo HTML preview support for the only metablock item.

This is sometimes added to block-type content to restrict its output to only certain formats (such as pdf, html, etc.). The preview should obviously show the output regardless, but it should somehow indicate that the only item has been set.

One simple way to achieve this would be adding an "info box" around the tagged content, similar to the way document objects are displayed. Since this metablock item can be added to basically any block-type content, instead of creating some "mixin" or a function to be used in every renderer, a rendering "middleware" system could be developed.

Add project description

Add basic project description. Emphasize that the project is very much a work in progress.

Set up CI tests

Set up GitHub Actions to run package tests (specs) upon every commit.

MathJax doesn't typeset when there is only one math element to be typeset

It works correctly when there are more elements to be typeset (even with just 2 it seems to work reliably). But once there is only 1 element (no matter whether it's block or inline math) to be typeset, it's just empty (it's correctly added to the queue to be typeset, but after some time the queue is emptied by MathJax without any result). If it's manually added to the queue again from the console, then it finally gets typeset.

This might possibly be caused by triggering the typetting too soon (before the elements are actually displayed in the pane).

Tweak dev environment settings

Various development environment tweaks, mainly to do with TypeScript and ESLint:

  • Change tsconfig.tsbuildinfo location (see this for more info); this will make preparing dist package cleaner
  • Use Node.js style TypeScript module resolution (see the docs); this will enable importing local modules without having to specify "index.ts"
  • Specify output module type to the TS compiler and use whichever target is the latest supported by Atom
  • Configure ESLint globals and overrides (see e.g. this Atom config)
  • Reformat .gitignore in style of .prettierignore, to make it cleaner for any future expansion

Add WooWoo preview

Preview currently opened WooWoo document in an HTML view pane to be opened to the side of the editor. Utilize the existing HTMLViewModel (and expand it with any functionality needed), WooWoo parsing and rendering. Watch for active open editor and its content changes.

Different ESLint report when linting built project

As seen with commit e7037b8, when the lint:check task is run without the project being built, it reports two @typescript-eslint/no-unsafe-member-access errors. When running the lint:check task after running the build task (or on an already built project), there are no issues reported.

What's even more strange is that many other rules are reported correctly, no matter if the project is built or not.

This behavior was reproduced on both Windows 10 and Ubuntu 18 (inside WSL).

Use Atom's Less color variables

Use Atom's Less color variables where (fixed) custom colors are in use as of now. This will improve the contrast between these colors and any other colors of the UI theme used by the user.

Refactor and modularize the currently used Less stylesheets.

Feel free to tweak any other styles (such as making the preview footnotes stand out less, after all a footnote should be less important than the rest of the content).

Add navigation pane

Add navigation pane with table of contents (document parts), and list of labels of the currently opened WooWoo file. Both of these should support fuzzy search (use a library) among their respective items.

Set up CI build check

Set up GitHub Actions to check that the project builds successfully upon every commit.

Set up tests

Set up package tests (specs). A simple dummy test will do for now (as there is nothing to test now really).

Add a script to clean up build output

Add a script to clean up build output. This can be useful e.g. when a spec file is deleted but it remains in the build output and thus fails test runs.

Improve testing setup

Improve testing setup by:

  1. Using a custom Atom test runner with an up to date testing framework (Atom's default test runner uses outdated Jasmine 1.3 due to compatibility reasons)
    • Most of the available test runners (e.g. there's one for Jest, and this one for Mocha) seem to have issues and have not been updated in a long time. This Jasmine 3 test runner however seems to be functional, well documented, and actively mantained. There is also this custom tester package with multiple test runner providers utilizing different testing frameworks, it's all however again long unmaintained.
    • This will make e.g. testing asynchronous code easier
  2. Setting up a mocking library like Sinon.js
  3. Creating mocked unit tests for HTMLViewModel

Error generating TikZ SVG: ENOENT: no such file or directory, mkdir

Seems to happen only on macOS. See image of the error included below.

tikz-error-enoent-mkdir

While mkdir isn't called directly by Wootom, fs.emptyDir() from fs-extra is used for ensuring clean (and existing) directory for generating DVI and SVG files from TikZ code. This function "Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted." The directory currently used is the CWD/PWD of the Atom process. Therefore one possible explanation of what is happening is an issue with permissions on macOS. I don't have a macOS device to make sure that's the case / to test the fix, but changing the directory used is probably better anyway.

One possibility is to use the current project directory instead, but it might require users to add the .wootom directory to the project's .gitignore (if the project uses Git). A better option seems to be using the tmp directory of the OS, which we can get using os.tmpdir().

Add WooWoo parser

Implement a parser of a WooWoo document and an AST model.

Use this YAML parsing library to parse metablocks (less work, well tested, more secure than a custom solution). Additionally use lodash or some other similar library if appropriate.

Create "Hello World"

Create a simple Atom package which prints Hello World to the console (e.g. when Atom is started, but it doesn't really matter when).

Add rendering of TikZ images

Add rendering of TikZ images to SVG (in the !tikz outer environments provided by the FIT Template) using a local TeX distribution. Attempt to show the user the TeX log if/when it fails. Allow users to customize the LaTeX preamble used (similarly to how they can set custom MathJax macros). Cache the generated SVGs. Offer multiple modes of displaying SVGs to accommodate different UI themes.

Add WooWoo AST to HTML renderer

Add a renderer which creates an HTML document from a given WooWoo AST. Use styles based on the FIT template.

Add support for math rendering using MathJax 2.6 (it's much faster than the newer versions while supporting all the macros we need). Support for TikZ rendering can remain unimplemented for now.

Improve TikZ error reports

Improve TikZ error reports by including the stack trace and making it clearer to the user that the error details can be shown by clicking on the summary.

Test on minimum supported Atom version (along with latest stable version) in CI

As per my request, action-setup-atom has added the options to select the exact version of Atom to use for testing. The feature has been added in version 2, which is now available. This allows us to add the minimum supported Atom version to the CI testing matrix. As long as Atom stays on the same major version (and these don't seem to change frequently, as Atom is still on v1.x), this should ensure everything works also on all minor versions inbetween the tested ones (assuming semantic versioning rules are followed properly).

Update the version of action-setup-atom used in our Github Actions setup and add the minimum supported Atom version (1.54) to the testing matrix.

Improve WooWoo grammar accuracy for better syntax highlighting

  1. Comments must begin at the start of a line

    Examples:

    % This is a valid comment
        % This is not a valid comment
    Some text of a paragraph... % This is also not a valid comment
    
  2. Document parts must also begin at the start of a line (no indentation allowed)

    Examples:

    % This is a valid document part heading
    .Chapter Name of Chapter 1
        label: chap-1
    
    % This is not a valid document part heading
        .Chapter Name of Chapter 2
            label: chap-2
    

Infinite loop during document render causing crash

Minimal reproducible example:

foo

  "bar".1
    1:
      link: 'http://example.com/'

Steps to reproduce:

  1. Open Atom with Wootom enabled
  2. Paste the example above into some (even empty) file
  3. Open Wootom Preview
  4. Crash

Add a script and a CI job for production package creation

Add a simple script for production package creation. Ideally this script should be as much isolated from the source code as possible.

Add a CI job using this script to create a production package and upload it as job artifact.

Set up Prettier CI check

Set up GitHub actions workflow job to check that source is properly formatted. This should be probably run only after build check passes.

Set up ESLint CI check

Set up GitHub actions workflow job to check that source passes linting. This should be probably run only after build check passes.

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.