ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๋ฐ˜์‘ํ˜•

๋ชฉ์ฐจ

    โœ… ํ‹ฐ์Šคํ† ๋ฆฌ ๋ชฉ์ฐจ ๋งŒ๋“ค๊ธฐ

    ๋‹ค๋ฅธ ๋ธ”๋กœ๊ทธ๋ฅผ ๋ณด๋‹ค๋ณด๋‹ˆ๊น ๋ชฉ์ฐจ๊ฐ€ ์žˆ๊ธธ๋ž˜ ๊ธฐ๋ณธ ๊ธฐ๋Šฅ์ธ์ค„ ์•Œ์•˜๋Š”๋ฐ ์•„๋‹ˆ๋”๋ผ๊ตฌ์š”. ๊ทธ๋ž˜์„œ ๊ฒ€์ƒ‰์„ ํ•ด๋ณด๋‹ˆ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ธ”๋กœ๊ทธ ์ค‘์— ์•„์ฃผ ์นœ์ ˆํžˆ ์ž˜ ์ž‘์„ฑ๋œ https://sangminem.tistory.com/307 ๊ธ€์„ ์ฐธ๊ณ ๋กœ ํ•ด์„œ ๋‚ด ์ž… ๋ง›์— ๋งก๊ฒŒ ์ˆ˜์ •์„ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

    jQuery.toc ๋‹ค์šด๋กœ๋“œ 

    ์•„๋ž˜ ๋งํฌ๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ๋‹ค์šด๋กœ๋“œ๋ฅผ ํ•˜๊ณ  ์••์ถ•์„ ํ’€์–ด์ฃผ์„ธ์š”

    https://ndabas.github.io/toc/assets/jquery.toc.zip

    ํŒŒ์ผ ์—…๋กœ๋“œ 

    ๊ด€๋ฆฌํŽ˜์ด์ง€ > ๊พธ๋ฏธ๊ธฐ > ์Šคํ‚จ ํŽธ์ง‘ > html > ํŒŒ์ผ์—…๋กœ๋“œ ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    ์ถ”๊ฐ€๋ฅผ ์„ ํƒํ•˜์—ฌ jquery.toc.min.js ํŒŒ์ผ์„ ์„ ํƒํ•˜์—ฌ ์—…๋กœ๋“œ๋ฅผ ํ•˜๊ณ  ์ ์šฉ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค

     

     

    ์œ„์™€ ๊ฐ™์ด ํŒŒ์ผ์ด ์—…๋กœ๋“œ ์ž˜๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค ^^

    HTML ์ˆ˜์ •ํ•˜๊ธฐ 

    HTML์„ ์„ ํƒํ•˜์—ฌ ์ด๋™ํ•ด์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋„ฃ์–ด์ฃผ๊ณ  ์ ์šฉํ•ด์ฃผ์„ธ์š”

    <!-- ๋ชฉ์ฐจ์ƒ์„ฑ ์Šคํฌ๋ฆฝํŠธ ์‹œ์ž‘-->
    <script src="./images/jquery.toc.min.js"></script>
    <script>
        // ๋ชฉ์ฐจ ์ƒ์„ฑ
        $(document).ready(function() {
            var $toc = $("#toc");
            $toc.toc({content: ".tt_article_useless_p_margin", headings: "h2,h3,h4"});
            
            // ์ถ”๊ฐ€๋œ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค
            if($('.another_category').length > 0) {
                $toc.find('li:last').remove();
            }
        });
    </script>
    <!-- ๋ชฉ์ฐจ์ƒ์„ฑ ์Šคํฌ๋ฆฝํŠธ ๋ -->

    ์Šคํฌ๋ฆฝํŠธ ๋„ฃ๋Š” ์œ„์น˜๋Š” </body> ์œ„์— ๋‹ค๊ฐ€ ๋„ฃ์–ด์ฃผ์„ธ์š” 

    CSS ์Šคํƒ€์ผ ์ ์šฉ 

    CSS ์„ ํƒํ•˜์—ฌ ์ด๋™ํ•ด์„œ ๊ฐ€์žฅ ํ•˜๋‹จ์— ์•„๋ž˜์™€ ๊ฐ™์ด css์ฝ”๋“œ๋ฅผ ๋„ฃ์–ด์ฃผ์„ธ์š”

    /* ๋ชฉ์ฐจ ์Šคํƒ€์ผ */
    .book-toc {
        position: relative;
        /*width: fit-content;*/
        border: 1px solid #a1a1a1;
        padding: 10px 20px 10px 15px;
        z-index: 1;
    }
    .book-toc:after {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background-color: #c9c9c9;
        z-index: -1;
        opacity: 0.1;
    }
    .book-toc p {
        font-weight: bold;
        font-size: 1.2em !important;
        color: #000000;
    }
    #toc * {
        font-size: 20px;
        color: #000000;
    }
    #toc {
        margin-bottom: 0;
    }
    #toc a:hover {
    	  font-weight:bold;
        color: #6772ff;
    }
    #toc ul {
        margin-top: 5px;
        margin-bottom: 0px;
    }
    
    #toc > li:before {
        font-family: "Font_Awesome_5_Free";
        content: "\f14a";
        padding-right: 10px;
        color: #d73736;
    }
    
    #toc > li {
        padding-left: 0;
        text-indent: 0;
        list-style-type: none !important;
        margin: 10px 0 10px 0;
    }
    
    #toc > li > a {
        text-decoration:none;
    }
    
    #toc > li > ul li:before {
        font-family: "Font_Awesome_5_Free";
        content: "\f0a9";
        padding-right: 8px;
        color: #57a140;
    }
    
    #toc > li > ul {
        padding-left: 0px;
        margin-top: 0;
        margin-bottom: 0;
    }
    #toc > li > ul > li {
        font-size: 0.87em;
        padding-left: 0;
        text-indent: 0;
        list-style-type: none !important;
        margin-bottom: 0;
        margin-top: 5px;
    }
    #toc > li > ul > li > a {
        font-size: 1em;
        text-decoration:none;
    }
    
    #toc > li > ul > li > ul > li:before {
        content: "\f14a";
        padding-right: 5px;
        color: #5754ff;
    }
    
    #toc > li > ul > li > ul {
        padding-left: 10px;
        margin-top: 0;
        margin-bottom: 0;
    }
    #toc > li > ul > li > ul > li {
        font-size: 0.87em;
        padding-left: 0;
        text-indent: 0;
        list-style-type: none !important;
        margin-bottom: 0;
        margin-top: 3px;
    }
    #toc > li > ul > li > ul > li > a {
        font-size: 0.875em;
        text-decoration:none;
    }
    
    /* ๊ธ€ ์ œ๋ชฉ1,2,3 ์Šคํƒ€์ผ */
    .tt_article_useless_p_margin h2 {
    	text-align: left;
    	border-left: #e16262 12px solid;
    	border-bottom: 1px solid #e16262;
    	padding: 3px 0 3px 10px;
    	margin: 10px 0 10px 0;
    }
    .tt_article_useless_p_margin h3 {
    	text-align: left;
    	border-left: #57a13f 8px solid;
    	border-bottom: 1px solid #57a13f;
    	padding: 3px 0 3px 10px;
    	margin: 10px 0 10px 0;
    }
    .tt_article_useless_p_margin h4 {
    	text-align: left;
    	border-left: #5753ff 6px solid;
    	border-bottom: 1px solid #5753ff;
    	padding: 3px 0 3px 10px;
    	margin: 10px 0 10px 0;
    }

    ์„œ์‹ ์ €์žฅ ํ•˜๊ธฐ

    ๊ด€๋ฆฌ์ž ํŽ˜์ด์ง€ > ์„œ์‹๊ด€๋ฆฌ > ์„œ์‹์“ฐ๊ธฐ

    ์„œ์‹์“ฐ๊ธฐ์— ์•„๋ž˜์™€ ๊ฐ™์€ ํƒœ๊ทธ๋ฅผ ์ž…๋ ฅํ•ด์ค€๋‹ค (์ œ๋ชฉ: ๋ชฉ์ฐจ์‚ฝ์ž… ๋‚ด์šฉ: ์•„๋ž˜ํƒœ๊ทธ์ž…๋ ฅ)

    <div class="book-toc"> <p>๋ชฉ์ฐจ</p> <ul id="toc"></ul> </div>

     ํ…Œ์ŠคํŠธ๋กœ ๊ธ€ ์ž‘์„ฑํ•ด๋ณด๊ธฐ 

    ๊ธ€์ œ๋ชฉ ์ง€์ •

    ๊ธ€์ œ๋ชฉ1๋กœ ํ• ๊ฒƒ์ด๋‹ค (์ œ๋ชฉ1๋กœ ์ง€์ •)

    ๊ธ€์ œ๋ชฉ1์˜ ๋‚ด์šฉ

    ๊ธ€์ œ๋ชฉ2๋กœ ํ• ๊ฒƒ์ด๋‹ค (์ œ๋ชฉ2๋กœ ์ง€์ •)

    ๊ธ€์ œ๋ชฉ2์˜ ๋‚ด์šฉ

    ๊ธ€์ œ๋ชฉ3๋กœ ํ• ๊ฒƒ์ด๋‹ค (์ œ๋ชฉ3๋กœ ์ง€์ •)

    ๊ธ€์ œ๋ชฉ3์˜ ๋‚ด์šฉ

     

     ์„œ์‹ ์‚ฝ์ž… 

    ์˜ค๋ฅธ์ชฝ ์Šค์ƒท์ฒ˜๋Ÿผ ํƒœ๊ทธ๊ฐ€ ์‚ฝ์ž…๋œ ๋ถ€๋ถ„์ด ๋ณด์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์œ„์˜ ํƒœ๊ทธ๋ฅผ ๊ทธ๋Œ€๋กœ ๋‚˜๋‘๊ณ  ์ €์žฅํ•˜๋ฉด ๋ชฉ์ฐจ๊ฐ€ ์ ์šฉ์ด ์•ˆ๋ฉ๋‹ˆ๋‹ค.

     

     ๊ธฐ๋ณธ๋ชจ๋“œ -> HTML๋ชจ๋“œ 

    ๊ธฐ๋ณธ๋ชจ๋“œ์—์„œ <div class="book-toc"> <p>๋ชฉ์ฐจ</p> <ul id="toc"></ul> </div> ๋ถ€๋ถ„์„ ์ž˜๋ผ๋‚ด๊ธฐ ํ•œ ์ดํ›„

    ์•„๋ž˜์™€ ๊ฐ™์ด HTML๋ชจ๋“œ๋กœ ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.

    ์œ„์™€ ๊ฐ™์ด ๊ฐ€์žฅ ์ƒ๋‹จ์— ๋ถ™์—ฌ๋„ฃ๊ธฐ ํ•ด์ฃผ๊ณ  ์ €์žฅ

    ์œ„์™€ ๊ฐ™์ด ํ™•์ธ์„ ํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

    https://fontawesome.com/v5.15/icons?d=gallery&p=2&m=free

     

    Font Awesome

    The world’s most popular and easiest to use icon set just got an upgrade. More icons. More styles. More Options.

    fontawesome.com

    ๋ชฉ์ฐจ ๋ชจ์–‘ ๋ณ€๊ฒฝ

     

     

     

    ๊ณต์ง€์‚ฌํ•ญ
    ์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
    ์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
    Total
    Today
    Yesterday
    ๋งํฌ
    ยซ   2024/12   ยป
    ์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
    1 2 3 4 5 6 7
    8 9 10 11 12 13 14
    15 16 17 18 19 20 21
    22 23 24 25 26 27 28
    29 30 31
    ๊ธ€ ๋ณด๊ด€ํ•จ
    ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (80)
    ๐Ÿ“บ Develop (0)
    ๐ŸŒ‹ Error Fixed (5)
    ๐Ÿ— Tool (5)
    ๐Ÿ’ป MacBook M1 (15)
    ๐Ÿ“ฆ ETC (1)

    ์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค.