0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
We're going to need a way to represent all the different types of inline text. We're going to be parsing Markdown text, and outputting it to HTML, so we need an intermediate representation of the text in our code.
When I say "inline" I just mean text that is part of a larger block of text. For us, this includes:
**Bold text**
_Italic text_
`Code text`
[anchor text](url)

Everything else we're considering block level, like headings, paragraphs, and bullet lists, and we'll handle those later.
python3 src/main.py
./main.sh
# hello world
__pycache__/
This will prevent autogenerated __pycache__
directories from being committed to Git. Finally, create a src/textnode.py
file, and read on to see what it should contain.
Here's an example of how you can create an enum:
from enum import Enum
class Bender(Enum):
AIR_BENDER = "air"
WATER_BENDER = "water"
EARTH_BENDER = "earth"
FIRE_BENDER = "fire"
TextNode(TEXT, TEXT_TYPE, URL)
Where TEXT
, TEXT_TYPE
, and URL
are the values of the text
, text_type
, and url
properties, respectively.
You can get the string representation of the text_type
enum by using the .value
field.
TextNode(This is some anchor text, link, https://www.boot.dev)
Run and submit the CLI tests from the root of the project.
You can delete the files in the public
directory, they aren't needed anymore.
chmod +x main.sh
from cars import SuperCar
The Boot.dev CLI requires you to be signed in to submit your solution!
Copy/paste one of the following commands into your terminal:
Run
bootdev run cdae7fca-a7dc-4706-b2c5-7a03d66db1c9
Submit
bootdev run cdae7fca-a7dc-4706-b2c5-7a03d66db1c9 -s
Run the CLI commands to test your solution.
Login to view solution
Using the Bootdev CLI
The Bootdev CLI is the only way to submit your solution for this type of lesson. We need to be able to run commands in your environment to verify your solution.
You can install it here. It's a Go program hosted on GitHub, so you'll need Go installed as well. Instructions are on the GitHub page.