<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>https://fbnwiki.com/index.php?action=history&amp;feed=atom&amp;title=%EB%AA%A8%EB%93%88%3ATree_diagram</id>
	<title>모듈:Tree diagram - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="https://fbnwiki.com/index.php?action=history&amp;feed=atom&amp;title=%EB%AA%A8%EB%93%88%3ATree_diagram"/>
	<link rel="alternate" type="text/html" href="https://fbnwiki.com/index.php?title=%EB%AA%A8%EB%93%88:Tree_diagram&amp;action=history"/>
	<updated>2026-10-10T22:21:46Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://fbnwiki.com/index.php?title=%EB%AA%A8%EB%93%88:Tree_diagram&amp;diff=6521&amp;oldid=prev</id>
		<title>신사: 새 문서: local p = {}  --============  tree root  ================ function p.main(frame)     local i = 0     local str, gene = {}, {}     local code = {}     local codeinput = string.gsub(string.gsub(frame.args[1], &quot;[\n]+&quot;, &quot;\n&quot;), &quot;\n&quot;, &quot;&quot;, 1)     -- 입력한 코드     local rootClass = frame.args[2]     local nodestyle = frame.args[3] -- 노드 스타일     local nodeClass = frame.args[4] -- 노드 클래스     local linkstyle = frame.args[5] -- 링크 스타일     local linkclass...</title>
		<link rel="alternate" type="text/html" href="https://fbnwiki.com/index.php?title=%EB%AA%A8%EB%93%88:Tree_diagram&amp;diff=6521&amp;oldid=prev"/>
		<updated>2024-05-21T13:51:47Z</updated>

		<summary type="html">&lt;p&gt;새 문서: local p = {}  --============  tree root  ================ function p.main(frame)     local i = 0     local str, gene = {}, {}     local code = {}     local codeinput = string.gsub(string.gsub(frame.args[1], &amp;quot;[\n]+&amp;quot;, &amp;quot;\n&amp;quot;), &amp;quot;\n&amp;quot;, &amp;quot;&amp;quot;, 1)     -- 입력한 코드     local rootClass = frame.args[2]     local nodestyle = frame.args[3] -- 노드 스타일     local nodeClass = frame.args[4] -- 노드 클래스     local linkstyle = frame.args[5] -- 링크 스타일     local linkclass...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
--============  tree root  ================&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local i = 0&lt;br /&gt;
    local str, gene = {}, {}&lt;br /&gt;
    local code = {}&lt;br /&gt;
    local codeinput = string.gsub(string.gsub(frame.args[1], &amp;quot;[\n]+&amp;quot;, &amp;quot;\n&amp;quot;), &amp;quot;\n&amp;quot;, &amp;quot;&amp;quot;, 1)&lt;br /&gt;
    -- 입력한 코드&lt;br /&gt;
    local rootClass = frame.args[2]&lt;br /&gt;
    local nodestyle = frame.args[3] -- 노드 스타일&lt;br /&gt;
    local nodeClass = frame.args[4] -- 노드 클래스&lt;br /&gt;
    local linkstyle = frame.args[5] -- 링크 스타일&lt;br /&gt;
    local linkclass = frame.args[6] -- 링크 클래스&lt;br /&gt;
&lt;br /&gt;
    -- make tree node, link&lt;br /&gt;
    local function link() -- link&lt;br /&gt;
        return tostring(mw.html.create(&amp;quot;div&amp;quot;):addClass(linkclass):cssText(linkstyle):done())&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local function node(text) -- node&lt;br /&gt;
        return &amp;#039;&amp;lt;li&amp;gt;&amp;#039; .. link() .. tostring(&lt;br /&gt;
            mw.html.create(&amp;quot;span&amp;quot;)&lt;br /&gt;
            :addClass(&amp;#039;node &amp;#039; .. nodeClass)&lt;br /&gt;
            :cssText(nodestyle):wikitext(link() .. text):done())&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local function repeats(str, cha)&lt;br /&gt;
        local _, n = string.gsub(str, cha, &amp;quot;&amp;quot;)&lt;br /&gt;
        return n&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    for line in string.gmatch(codeinput, &amp;quot;([^\n]*)\n+&amp;quot;) do&lt;br /&gt;
        str[i] = string.gsub(string.gsub(line, &amp;quot;*%s*&amp;quot;, &amp;quot;*&amp;quot;), &amp;quot;*&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
        gene[i] = repeats(line, &amp;quot;*&amp;quot;)&lt;br /&gt;
        i = i + 1&lt;br /&gt;
    end&lt;br /&gt;
    --====================================&lt;br /&gt;
&lt;br /&gt;
    local rootBox = &amp;quot;&amp;lt;ul &amp;quot; .. rootClass .. &amp;quot;&amp;gt;&amp;quot; .. link()&lt;br /&gt;
    i = -1&lt;br /&gt;
    while str[i + 1] do&lt;br /&gt;
        i = i + 1&lt;br /&gt;
        local cont = node(str[i])&lt;br /&gt;
        if i == 0 then&lt;br /&gt;
            table.insert(code, rootBox .. cont)&lt;br /&gt;
            --      앞에보다  뒤에가 작다&lt;br /&gt;
        elseif gene[i - 1] &amp;lt; gene[i] then&lt;br /&gt;
            local times = gene[i] - gene[i - 1]&lt;br /&gt;
            for _ = 1, times do&lt;br /&gt;
                cont = &amp;#039;&amp;lt;ul&amp;gt;&amp;#039; .. link() .. cont&lt;br /&gt;
            end&lt;br /&gt;
            table.insert(code, cont)&lt;br /&gt;
&lt;br /&gt;
        elseif gene[i - 1] == gene[i] then&lt;br /&gt;
            table.insert(code, &amp;#039;&amp;lt;/li&amp;gt;&amp;#039; .. cont)&lt;br /&gt;
&lt;br /&gt;
        elseif gene[i - 1] &amp;gt; gene[i] then&lt;br /&gt;
            local times = gene[i - 1] - gene[i]&lt;br /&gt;
            for _ = 1, times do&lt;br /&gt;
                cont = &amp;#039;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&amp;#039; .. cont&lt;br /&gt;
            end&lt;br /&gt;
            table.insert(code, cont)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return table.concat(code)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>신사</name></author>
	</entry>
</feed>