Giter Club home page Giter Club logo

Comments (3)

flywire avatar flywire commented on June 26, 2024

The ContentHack branch was working towards my vision of allowing a configurable caption for any content based on the original concept. I refactored the code so it made more sense in that context. Unfortunately, my python OOP skills are inadequate and I've stalled.

iirc:

  1. I understand a superclass is needed once the content type is determined but I couldn't figure it out
  2. two lines are written in the wrong order for tables

Of course if it worked then tests would be needed.

Any PR to resolve these or any other issues would be welcome.

from caption.

sanzoghenzo avatar sanzoghenzo commented on June 26, 2024

That's wonderful to hear (well, read 😅 )!

OK, now I understand what you tried to do, and while my PR fixes all the tests, they aren't really good from an OOP perspective. But at least we now know that it works and that a refactor should always pass the tests.

We can make the various content types subclasses of the CaptionTreeprocessor and register each one in the extendMarkdown method, so that the parent class only has common code and the children only have specialized code.

I would gladly help you do this, let me know if you want to merge the current PR first or if it's ok to go all in with the overhaul.

PS: I already did some more refactorings, mainly to make it more compliant with the google style guide (variable/method/class naming) and to switch to pytest (just a personal preference, it avoids keeping a useless class around), but let's take it one step at a time 😉

from caption.

hendrikp avatar hendrikp commented on June 26, 2024

Small note in the wiki on page https://github.com/flywire/caption/wiki/Development#unittest

the line
python -m unittest -v test_caption.captionTestCase

should be replaced by
pytest --cov

As the testing framework was changed.

from caption.

Related Issues (8)

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.