

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: TextNode
incomplete
2: TextNode Tests
incomplete
3: HTMLNode
incomplete
4: LeafNode
incomplete
5: ParentNode
incomplete
6: TextNode to HTMLNode
incomplete
This lesson's interactive features are locked, please to keep using them
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