Comments (11)
Hello @olistic ,
I am a newbie , and this would be my second ever contribution. I would like to tackle this problem .
from warriorjs.
Hello @justdvnsh, that'd be awesome. How are you planning to tackle this?
from warriorjs.
So, i guess , after adding the -n
or --no-markdown
arg in the argument file parseArgs.js
I am planning to write a simple md to txt parsing engine using regex. Because I dont find any md to txt parsing libraries out there.. Also , the txt files , would not be containing the text decorations and images.
- Use readFileSync to read the md file
- Feed it to the md to txt parser so to remove the md elements , and images
- use writeFileSync to write the txt files.
What do you think ? Will this approach work ? It's a bit tedious though !
from warriorjs.
There are some libraries that strip markdown formatting characters from text you can try, like remove-markdown, but I don't know how well they'll fit our use case. What if you just create another ejs
template, but for the README.txt
?
from warriorjs.
Yes , using an ejs template seems like a pretty good option . We can make the characters dynamic . But still, we would need to change all the readme files to add the dynamic content.
So , I guess , instead of attaching readme files with the game , we can attach those ejs templates with the static data, in which the dynamic data ( i.e. markdown formatting chars ) will be populated on the fly , after the user specifying wether he needs markdown or text .
How about that ? Sounds good ?
from warriorjs.
If I understood correctly, you're suggesting using the existing template but making the markdown formatting characters visible only when markdown is enabled? I thought of that but I think the template will get too convoluted. That's why I suggest having another template/set of templates called README.txt.ejs
. This also allows us to make different formatting choices if we wanted in the text README, like this:
Markdown:
# Spartacus - beginner
## Level 1
...
Text:
Spartacus - beginner
--------------------
Level 1
...
from warriorjs.
Yes ,you understood that correctly. Yes , even I was wondering, that it will convolute the template . But I didn't really understand the solution you gave . If we will be using the README.txt.ejs template , then what will get added to it ( what will be the dynamic data ?
from warriorjs.
The existing template is called README.md.ejs
, which includes all the markdown formatting characters and is used to generate the markdown README (README.md
). We can add another template called README.txt.ejs
without markdown and use that to generate the text README (README.txt
) when the --no-markdown
flag is passed. The data we pass to the template in the render function should be the same for both templates, the only different is the file format and layout.
from warriorjs.
Okay yes . That sounds a pretty good solution.
Should I start implementing the feature ?
from warriorjs.
Go for it! Thanks
from warriorjs.
Sure thing !
from warriorjs.
Related Issues (20)
- How to contribute towers? HOT 1
- Any plans on i18n? HOT 1
- Documentation links are broken in many places HOT 1
- access to newer abilities in previous levels HOT 3
- Connect WarriorJS CLI with warriorjs.com HOT 2
- Add ability to get warrior's max health HOT 3
- brief description on each release HOT 3
- @warriorjs/tower-tick-tick-boom warrior haven't got the "pivot" ability and bashing 'backward' forcedly
- Should the warrior receive more damage when attacked from behind? HOT 1
- Add retro sounds HOT 2
- translate Korean HOT 2
- Korean Translation HOT 3
- Can't access functions from a Unit object
- Watch for Player.js changes and run
- I cannot sign in or create an account for the online platform HOT 2
- When I 'Run' the game after defeated, the state isn't refreshed unless I reload the page for several times HOT 1
- rescue('backward') is undefined HOT 3
- This code is wierdly running HOT 4
- where did constructor() come from and what is it? How does it work and what does it mean? I'm not able to learn anything here HOT 1
- Error: No files matching the pattern "packages/**/src" were found
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 warriorjs.