portal

https://github.com/djblue/portal
Felipe Nascimento 2021-05-18T17:42:40.000600Z

Hi there, Can I ask a question about portal?

Felipe Nascimento 2021-05-18T17:47:10.001100Z

it is possible change de default viewer from inspector to table?

Felipe Nascimento 2021-05-18T17:47:26.001200Z

djblue 2021-05-18T18:02:19.003100Z

Hi @blindcoding9, there isn't a way to do this globally, but you can set a default viewer for a value via metadata. (with-meta value {:portal.viewer/default :portal.viewer/table}) would be a work around for now.

djblue 2021-05-18T18:03:47.003600Z

However, I'm open to suggestions on how to improve the UX 👌

plexus 2021-05-18T18:48:13.003700Z

oh that's good to know. I agree I would also love to see a way to make the global sticky, but the metadata also opens some nice possibilities

djblue 2021-05-18T19:03:53.003900Z

^{:portal.viewer/default :portal.viewer/hiccup} [:div [:h1 "hello, world"] [:portal.viewer/tree {:some :data}]] 💯

djblue 2021-05-18T19:05:13.004100Z

djblue 2021-05-18T19:05:56.004500Z

You can paste the edn string directly into the https://djblue.github.io/portal/ and you get this view

djblue 2021-05-18T19:08:00.004700Z

You are looking at a string, parsed as edn, rendered as hiccup, with an element that is a portal viewer :aw_yeah: