rclement / datasette-dashboards

Datasette plugin providing data dashboards from metadata
https://datasette-dashboards-demo.vercel.app
Apache License 2.0
137 stars 7 forks source link

Lists not showing markers in Markdown component #139

Closed HaveF closed 1 year ago

HaveF commented 1 year ago

Hi, 😄

I found that markdown didn't show quite consistently.

select '# Analysis details

We wanted to analyze data from job offers, using the **`python` search keyword**
from three sources of job-boards:
[APEC](https://www.apec.fr),
[Indeed](https://fr.indeed.com/) and
[RegionsJob](https://regionsjob.com).

## Process

The process was in 3 steps:

* Extraction
* Transformation
* Loading

After the ETL process, an extra data enrichment step was developed to provide
location geocoding, based on place names.

## SQL query

```sql
SELECT
  date(date) as day,
  count(*) as count
FROM offers_view
GROUP BY day
ORDER BY day
```'
as demo_markdown

image

But when display in dashboars, there is no * before list items

image

HaveF commented 1 year ago

Oh, the sql part is also not right... there should no sql before SELECT

SELECT
  date(date) as day,
  count(*) as count
FROM offers_view
GROUP BY day
ORDER BY day
rclement commented 1 year ago

Thanks @HaveF for catching and reporting this issue!

But when display in dashboars, there is no * before list items

Indeed, there seem to be an issue with the Markdown rendering. I'll look for the culprit and see if I can fix it.

Oh, the sql part is also not right... there should no sql before SELECT

Mmmh interesting, this means the Markdown rendering does not support properly code blocks with language syntax highlighting (it could be rendered all monospace black but still skip the language information)

rclement commented 1 year ago

Ok I found out some interesting styling implementation details.

Here is the default style concerning ordered and unordered list in Datasette:

ol,
ul {
    list-style: none;
}

However, this is overriden by this style when displaying query results:

.rows-and-columns td ol,
.rows-and-columns td ul {
    list-style: initial;
    list-style-position: inside;
}

We might have to override this using the Datasette Dashboard stylesheet to restore bullet and numbered list only for the Markdown chart component.

HaveF commented 1 year ago

Could it possible add class col-demo_markdown?(It's a generated class name)

I notice you use render_markdown function, but why it not works...

How about {% markdown %}...{% endmarkdown %} ?