Git Product home page Git Product logo

Comments (13)

vedderb avatar vedderb commented on July 28, 2024 1

I can have a look at that.

Regarding maddy, I rewrote six of the parsers, but that is not visible in the commit unfortunately. The image parser has image caching support now:
https://github.com/vedderb/vesc_tool/blob/master/maddy/imageparser.h

I also spent a lot of work on the codeblock parser and I rewrote four others as they were super slow
progsource/maddy#50 (comment)

For QMarkdownEdit I fixed one bug that made it crash during some of the edit operations and I added support for changing the colors of everything depending on the vesc tool theme.

from vesc_tool.

Tomblarom avatar Tomblarom commented on July 28, 2024

Same issue for code snippets, like in Code Server... @vedderb haven't you noticed that yet in your own packages?

image
image

from vesc_tool.

vedderb avatar vedderb commented on July 28, 2024

Can you try with the latest beta? The markdown-support in Qt is not that good and in the latest beta I'm trying to manually parse it and generate html from it instead. It should work better for code blocks, but I'm not sure if https-images work for all platforms. Http should work.

from vesc_tool.

Tomblarom avatar Tomblarom commented on July 28, 2024

Saw your commit, great that there is such a library as maddy!

For code-blocks, yes they are working now :)
For https-images on Windows, yes it does also load from https! Is there a chance to include images in the package, as local resource, rather than external? Might be a little bit overkill, but images help a lot to explain stuff visually.

from vesc_tool.

Tomblarom avatar Tomblarom commented on July 28, 2024

Resizing is not working yet. It tried to use HTML <img src=".." alt=".." width="300"/>.

from vesc_tool.

vedderb avatar vedderb commented on July 28, 2024

This is what you can get working in the Qt editors:
https://doc.qt.io/qt-6/richtext-html-subset.html#block-attributes
You can see that img does not support the resize attribute. I can maybe fix that too by updating the image-parser to resize the image before caching it, but best is to scale the image to the correct size from the start.

from vesc_tool.

vedderb avatar vedderb commented on July 28, 2024

I tested the list now, it works for me. Do you have a way to reproduce the problem?

from vesc_tool.

Tomblarom avatar Tomblarom commented on July 28, 2024

Do you have a way to reproduce the problem?

The issue was on my side, therefor I deleted it. The line before 1. contained a space.

from vesc_tool.

Tomblarom avatar Tomblarom commented on July 28, 2024

btw, loading existing packages into VESC Tool under "Create Package" is broken currently. :(

image
image

Loading on "Load Custom" works fine :)

from vesc_tool.

vedderb avatar vedderb commented on July 28, 2024

That happens because I broke compatibility a bit with old packages by storing the raw data as markdown instead of html. I will add some code to detect if it is an old package and load the text as html instead.

Regarding images, I think I can embed them in the packages so that they are stored locally. It is a bit tricky to make that work so that github also renders the images correctly, but I think it can be done with some clever caching.

from vesc_tool.

vedderb avatar vedderb commented on July 28, 2024

This fix should allow opening old packages properly: 1275db4

I have also added a markdown preview that is updated live next to the markdown editor:

bild

The beta is updated now.

from vesc_tool.

Tomblarom avatar Tomblarom commented on July 28, 2024

I tried your new editor with a .vescpkg that has been created with the previous version of VESC-Tool "Create Package". I send you the file.

I experience that the live-updates are very slow (1-2s), because it has an embedded image which is not beeing rendered, but shown as: ![image](data:image/13196.PNG;base64,i VBORw0KGgoAAAANSU.....hEUgAAAfQSUVORK5CYII=). Page "Load Custom" renders it correctly.

I'm running Windows 10 21H2 and do compile using Qt Creator 11.0.3, Qt 5.15.2, MinGW 8.1.0 64-bit and CMake 3.24.2. I also tried to make a release with windeployqt build-vesc_tool-Desktop_Qt_5_15_2_MinGW_64_bit-Release\release, but same outcome.

And the order of generated Markdown-symbols are a little bit mixed in page "Create Package": **_Locate Connector**_ instead of **_Locate Connector_**

Code block generation is like this:
image

from vesc_tool.

vedderb avatar vedderb commented on July 28, 2024

Conversion to markdown will not be perfect from old packages, it is mostly a help to transition from them to markdown. Base64 for the images (which was used before) will also not work that well with markdown. The load package page will work better in comparison as it does not try to convert it to markdown.

from vesc_tool.

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.