Comments (3)
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:
- I understand a superclass is needed once the content type is determined but I couldn't figure it out
- 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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caption.