feat(proofs): some proofs
This commit is contained in:
parent
a5f0d6c479
commit
f0c1c15002
5 changed files with 198 additions and 24 deletions
41
src/components/Pseudocode.astro
Normal file
41
src/components/Pseudocode.astro
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
interface Props {
|
||||
code: string;
|
||||
}
|
||||
|
||||
const lines = Astro.props.code
|
||||
.trim()
|
||||
.split(/\r?\n/);
|
||||
---
|
||||
<style lang="css">
|
||||
.pseudocode-block {
|
||||
font-family: "Times New Roman", serif;
|
||||
font-size: 1rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.pseudocode-line {
|
||||
display: flex;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.line-number {
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
margin-right: 1em;
|
||||
user-select: none;
|
||||
}
|
||||
.line-content {
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
{ console.log(lines) }
|
||||
|
||||
<pre class="pseudocode-block">
|
||||
{lines.map((line, i) => (
|
||||
<div class="pseudocode-line" key={i}>
|
||||
<span class="line-number">{i + 1}.</span>
|
||||
<span class="line-content">{line}</span>
|
||||
</div>
|
||||
))}
|
||||
</pre>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue