<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to change spacing between lines]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I am trying to make a slight modification to a module that was discussed in this forum post:<br />
<a href="https://forum.magicmirror.builders/topic/555/txt-file-include">https://forum.magicmirror.builders/topic/555/txt-file-include</a></p>
<p dir="auto">This module does an excellent job of displaying the contents of a text file (and also seems to support some html formatting).  However, when displaying this you see large spaces between each new line of text.  I would love it if there is some way to alter this and have more “normal” spacing between each line. Can anyone help with this?</p>
<p dir="auto">below is the current contents of the following files…</p>
<p dir="auto">MMM-Text.js:</p>
<pre><code>Module.register("MMM-Text",{
    defaults: {
    updateInterval: 30 * 60 * 1000 //reads the file every 30 mins
},

start: function(){
    this.sendSocketNotification('START', this.config);
},

socketNotificationReceived: function(notification, payload) {
    if(notification === 'DATA'){
        this.dataFile = payload;
        this.updateDom();
    }
},

getDom: function(){
    var wrapper = document.createElement('div');
    if(this.dataFile){
        wrapper.innerHTML = this.dataFile;
    } else {
        wrapper.innerHTML = 'No data';
    }
    return wrapper;
}
});
</code></pre>
<p dir="auto">node_helper.js:</p>
<pre><code>const NodeHelper = require("node_helper");
const fs= require("fs");

module.exports = NodeHelper.create({
    socketNotificationReceived: function(notification, payload) {
    if(notification === 'START'){
        this.config = payload;
        this.readData();
        setInterval(() =&gt; {
            this.readData();
        }, this.config.updateInterval);
    }
},

readData: function(){
    //to read a file to do the following
    fs.readFile('/home/pi/MagicMirror/modules/MMM-Text/mmText.txt', 'utf8', (err, data) =&gt; {
        if (err) throw err;
        this.sendSocketNotification('DATA', data);
    });
}
});
</code></pre>
<p dir="auto">example of mmText.txt (the file that will be displayed):</p>
<pre><code>&lt; font size="3" &gt;
Attic: 85°&lt;br /&gt;
Crawlspace: 77°&lt;br /&gt;
Den: 77°&lt;br /&gt;
Rack: 71°&lt;br /&gt;
&lt; /font &gt;
</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/7423/how-to-change-spacing-between-lines</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 02:32:03 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/7423.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Jun 2018 15:11:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to change spacing between lines on Fri, 22 Jun 2018 11:50:45 GMT]]></title><description><![CDATA[<p dir="auto">A couple different things you can do here…</p>
<p dir="auto">One put the data in a table…<br />
or<br />
Two…<br />
You could just either use CSS to do this OR create your element like this:</p>
<pre><code>
                var foo= document.createElement("p");
	        foo.classList.add("whatever ");   CSS
 OR
	       foo.setAttribute('style', 'line-height: 20%;');  No CSS```

</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/40744</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/40744</guid><dc:creator><![CDATA[cowboysdude]]></dc:creator><pubDate>Fri, 22 Jun 2018 11:50:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to change spacing between lines on Wed, 20 Jun 2018 11:49:21 GMT]]></title><description><![CDATA[<p dir="auto">there are temperatures that are gathered by other computers in other locations in my house and I am trying to monitor those values - I have a script from another computer that builds this text file each hour and copies it to the magic mirror.</p>
]]></description><link>https://forum.magicmirror.builders/post/40705</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/40705</guid><dc:creator><![CDATA[big_nunz]]></dc:creator><pubDate>Wed, 20 Jun 2018 11:49:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to change spacing between lines on Tue, 19 Jun 2018 21:12:45 GMT]]></title><description><![CDATA[<p dir="auto">For my curiosity. What is the use case behind here? What is the content of that text file?</p>
]]></description><link>https://forum.magicmirror.builders/post/40689</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/40689</guid><dc:creator><![CDATA[rak]]></dc:creator><pubDate>Tue, 19 Jun 2018 21:12:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to change spacing between lines on Tue, 19 Jun 2018 16:39:17 GMT]]></title><description><![CDATA[<p dir="auto">Figured I would post the answer I came up with to solve this in case anyone else runs into the same problem - I wrapped the text in a &lt; p &gt; and added line-height styling to that - see below for an example:</p>
<pre><code>&lt; font size="3" &gt;
&lt; p style="line-height:100%" &gt;
Attic: 112°&lt;br /&gt;
Crawlspace: 80°&lt;br /&gt;
Den: 80°&lt;br /&gt;
Rack: 71°&lt;br /&gt;
Garage: 77°&lt;br /&gt;
&lt; /p &gt;
&lt; /font &gt;
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/40672</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/40672</guid><dc:creator><![CDATA[big_nunz]]></dc:creator><pubDate>Tue, 19 Jun 2018 16:39:17 GMT</pubDate></item></channel></rss>