radiantearth / source-cooperative

Source Cooperative
https://beta.source.coop
39 stars 0 forks source link

Markdown renderer doesn't show content #33

Open m-mohr opened 7 months ago

m-mohr commented 7 months ago

I've uploaded the following Markdown:

# Field boundaries for North Rhine-Westphalia (NRW), Germany

Provides ca. 300.000 official field boundaries from the federal state of North Rhine-Westphalia (NRW) in Germany.
It has been converted to a fiboa GeoParquet file from a shapefile that was provided by the state.

- **Source Data Provider:** [Land Nordrhein-Westfalen / Open.NRW](https://www.opengeodata.nrw.de/produkte/umwelt_klima/bodennutzung/landwirtschaft/)
- **Converted by:** [Matthias Mohr](https://mohr.ws)
- **License:** [Data licence Germany – attribution – Version 2.0](https://www.govdata.de/dl-de/by-2-0)
- **Projection:** EPSG:25832 (UTM 32N)

**[DOWNLOAD THE DATA AS FIBOA GEOPARQUET](DGL_EPSG25832_Parquet.parquet)**

## Columns

| Property               | Data Type | Description                                                  |
| ---------------------- | --------- | ------------------------------------------------------------ |
| id                     | string    | Numerical internal identifier                                |
| inspire:id             | string    | INSPIRE-compliant identifier. Example: `https://geodaten.nrw.de/id/inspire-lc-dgl/landcoverunit/6467974` |
| flik                   | string    | Area identifier for field blocks. Example: `DENWLI0552020444` |
| determination_datetime | datetime  | Valid since the given date.                                  |

## Lineage 

- Data downloaded on 2024-02-01 from <https://www.opengeodata.nrw.de/produkte/umwelt_klima/bodennutzung/landwirtschaft/DGL_EPSG25832_Shape.zip>.
- Converted to GeoParquet using [fiboa-cli](https://github.com/fiboa/cli), development version from 2024-04-02.

It doesn't render, Console shows:

Uncaught (in promise) 24:45: Unexpected character / (U+002F) before local name, expected a character that can start a name, such as a letter, $, or _ (note: to create a link in MDX, use [text](url))

m-mohr commented 7 months ago

It seems the issues is the link: <https://www.opengeodata.nrw.de/produkte/umwelt_klima/bodennutzung/landwirtschaft/DGL_EPSG25832_Shape.zip> I think <> for links are valid?

m-mohr commented 7 months ago

Another issue occurs for the relative link to the parquet file. This creates a link as follows: https://beta.source.coop/repositories/[account_id]/[repository_id]/DGL_EPSG25832_Parquet.parquet Clicking it leads to a weird page with undefined values and a constantly loading top. The Download button doesn't work. grafik

raymondben commented 7 months ago

Have run into the same issue. Also seems that html comments <!-- like this --> cause it. And if you hand-edit the md and accidentally put a malformed link in (oopsie!), you can get a complete crash of the page where nothing renders and it just gives

Application error: a client-side exception has occurred (see the browser console for more information).

as an error message on an otherwise empty, black page, with the browser developer console showing:

Error: Minified React error #62; visit https://reactjs.org/docs/error-decoder.html?invariant=62 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    NextJS 29

A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
cboettig commented 7 months ago

Thanks for filing this, I also noticed that using angle brackets in README urls etc prevents them from rendering and meant to file an issue. It's quite annoying since it's not easy to debug, even more so since there's no web-edit mechanism for readme (as you mention in #30 )

kbgg commented 7 months ago

The markdown viewer is incredibly basic and relies heavily on the mdx and remark libraries -- it was intended to be a starting point to allow basic rendering of markdown files with the expectation that it will be improved with additional debugging and features later on. The source code for the markdown viewer is available in the Source Viewers Repository and we welcome any contributions there!

m-mohr commented 7 months ago

I made pretty good experience with the commonmark js parser. But it might be a little limiting as it doesn't support tables for example.

Anyway, could you fall back to just rendering the plain markdown in case of an error? An endless loading screen seems worse than just plain markdown, which is usually pretty human readable.

kbgg commented 7 months ago

Better error handling would be a great contribution. I'd welcome any pull requests which added this, otherwise this will have to wait a bit before I can implement it as the backlog is growing quicker than I can tackle issues.