This commit improves markdown rendering to convert reference labels (e.g., `[1]`) to superscripts, improving document readability without cluttering the text. This improvement applies documentation of all scripts and categories. Changes: - Implement superscript conversion for reference labels within markdown content, ensuring a cleaner presentation of textual references. - Enable HTML content within markdown, necessary for inserting `<sup>` elements due to limitations in `markdown-it`, see markdown-it/markdown-it#999 for details. - Refactor markdown rendering process for improved testability and adherence to the Single Responsibility Principle. - Create `_typography.scss` with font size definitions, facilitating better control over text presentation. - Adjust external URL indicator icon sizing for consistency, aligning images with the top of the text to maintain a uniform appearence. - Use normal font-size explicitly for documentation text to ensure consistency. - Remove text size specification in `markdown-styles` mixin, using `1em` for spacing to simplify styling. - Rename font sizing variables for clarity, distinguishing between absolute and relative units. - Change `font-size-relative-smaller` to be `80%`, browser default for `font-size: smaller;` CSS style and use it with `<sup>` elements. - Improve the logic for converting plain URLs to hyperlinks, removing trailing whitespace for cleaner link generation. - Fix plain URL to hyperlink (autolinking) logic removing trailing whitespace from the original markdown content. This was revealed by tests after separating its logic. - Increase test coverage with more tests. - Add types for `markdown-it` through `@types/markdown-it` package for better editor support and maintainability. - Simplify implementation of adding custom anchor attributes in `markdown-it` using latest documentation.
83 lines
1.6 KiB
Vue
83 lines
1.6 KiB
Vue
<template>
|
|
<ModalContainer
|
|
v-model="showDialog"
|
|
>
|
|
<div class="dialog">
|
|
<div class="dialog__content">
|
|
<slot />
|
|
</div>
|
|
<FlatButton
|
|
icon="xmark"
|
|
class="dialog__close-button"
|
|
@click="hide"
|
|
/>
|
|
</div>
|
|
</ModalContainer>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, computed } from 'vue';
|
|
import FlatButton from '@/presentation/components/Shared/FlatButton.vue';
|
|
import ModalContainer from './ModalContainer.vue';
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
ModalContainer,
|
|
FlatButton,
|
|
},
|
|
props: {
|
|
modelValue: {
|
|
type: Boolean,
|
|
required: true,
|
|
},
|
|
},
|
|
emits: {
|
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
'update:modelValue': (isOpen: boolean) => true,
|
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
},
|
|
setup(props, { emit }) {
|
|
const showDialog = computed({
|
|
get: () => props.modelValue,
|
|
set: (value) => {
|
|
if (value !== props.modelValue) {
|
|
emit('update:modelValue', value);
|
|
}
|
|
},
|
|
});
|
|
|
|
function hide() {
|
|
showDialog.value = false;
|
|
}
|
|
|
|
return {
|
|
showDialog,
|
|
hide,
|
|
};
|
|
},
|
|
});
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
@use "@/presentation/assets/styles/main" as *;
|
|
|
|
.dialog {
|
|
margin-bottom: 10px;
|
|
display: flex;
|
|
flex-direction: row;
|
|
|
|
&__content {
|
|
margin: 5%;
|
|
}
|
|
|
|
.dialog__close-button {
|
|
color: $color-primary-dark;
|
|
width: auto;
|
|
font-size: $font-size-absolute-large;
|
|
margin-right: 0.25em;
|
|
align-self: flex-start;
|
|
}
|
|
}
|
|
</style>
|