RonX
April 2, 2024, 1:32pm
1
I want to see how a card is rendered in Anki Mobile (iOS). My idea was to insert some JavaScript into the card template and write the HTML code to a txt file inside the collection.media folder. But I’m not sure how to write to a txt file. Is this even possible?
Thanks
1 Like
dae
April 3, 2024, 5:53am
2
You can’t write to the filesystem, but you can place the debug text you want into a div in the DOM, and view it from there.
2 Likes
RonX
April 3, 2024, 1:17pm
3
It’s not ideal, but it works. Here is the code for anyone interested:
<script>
var htmlContent = document.documentElement.outerHTML
var container = document.getElementById('htmlCodeContainer')
container.textContent = htmlContent
</script>
<div id="htmlCodeContainer"
style="
font-size: small;
white-space: pre;
overflow-x: auto;
background: #f9f9f9;
border: 1px solid #ddd;
margin-top: 20px;
padding: 10px;">
</div>
Edit: And thanks for your help!
2 Likes
system
Closed
May 3, 2024, 1:17pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.