mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Add script to fetch and display a shared aider chat transcript.
This commit is contained in:
parent
03ac5202dd
commit
4f8627e81f
1 changed files with 29 additions and 0 deletions
29
share/index.md
Normal file
29
share/index.md
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
# Shared aider chat transcript
|
||||||
|
|
||||||
|
A user has shared the following transcript of a pair programming chat session
|
||||||
|
created using <a href="https://aider.chat">aider</a>.
|
||||||
|
|
||||||
|
<div class="chat-transcript">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.onload = function() {
|
||||||
|
var urlParams = new URLSearchParams(window.location.search);
|
||||||
|
var conv = urlParams.get('mdurl');
|
||||||
|
fetch(conv)
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(markdown => {
|
||||||
|
// Ensure every line that starts with '>' ends with exactly 2 spaces
|
||||||
|
markdown = markdown.split('\n').map(function(line) {
|
||||||
|
if (line.startsWith('>')) {
|
||||||
|
return line.trimEnd() + ' ';
|
||||||
|
}
|
||||||
|
return line;
|
||||||
|
}).join('\n');
|
||||||
|
var html = marked.parse(markdown);
|
||||||
|
var divElement = document.querySelector('.chat-transcript');
|
||||||
|
divElement.innerHTML = html;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue