Skip to content

Commit fd9f98d

Browse files
authored
Merge pull request #1265 from mito-ds/move-mito-cta-on-excel-to-python
trymito.io: move up the mitosheet CTA
2 parents 7111eda + efcdf2b commit fd9f98d

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

trymito.io/pages/excel-to-python/[...slug].tsx

+32-29
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,38 @@ const ExcelToPythonGlossaryPage = (props: {pageContent: PageContent, glossaryPag
175175
})}
176176
</section>
177177

178+
{pageContent.mitoCTA !== undefined &&
179+
<section className={excelToPythonStyles.section}>
180+
<div className={pageStyles.background_card} style={{padding: '10px', marginTop: '10px', borderRadius: '10px'}}>
181+
<h3
182+
id={`Mito's ${functionNameShort} function`}
183+
className={classNames(excelToPythonStyles.section_h3_tag, excelToPythonStyles.link)}
184+
style={{marginTop: '5px'}}
185+
>
186+
Use Mito&apos;s {functionNameShort} function</h3>
187+
<p>
188+
Mito is an open source library that lets you write Excel formulas in Python. Either write the formula directly in Python or <Link href='/spreadsheet-automation'><a className={pageStyles.link}>use the {functionNameShort} formula in the Mito Spreadsheet</a></Link> and generate the equivalent Python code automatically.
189+
</p>
190+
<p>
191+
Mito&apos;s {functionNameShort} function works exactly like it does in Excel. That means you don&apos;t need worry about managing data types, handling errors, or the edge case differences between Excel and Python formulas.
192+
</p>
193+
<p>
194+
<a href={MITO_INSTALLATION_DOCS_LINK} target="_blank" rel="noreferrer" className={classNames(pageStyles.link, PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_IN_CONTENT_CTA)}>Install Mito</a> to start using Excel formulas in Python.
195+
</p>
196+
<CodeBlock
197+
className={PLAUSIBLE_COPIED_CODE_MITO_EXPORTED_FUNCTION}
198+
>
199+
{[
200+
"# Import the mitosheet Excel functions",
201+
"from mitosheet.public.v3 import *;",
202+
"",
203+
`# Use Mito's ${functionNameShort} function`
204+
].concat(pageContent.mitoCTA.codeLines).join('\n')}
205+
</CodeBlock>
206+
</div>
207+
</section>
208+
}
209+
178210
{/* Equivalent Python Code Using Pandas */}
179211
<section className={excelToPythonStyles.section}>
180212
<h2
@@ -207,35 +239,6 @@ const ExcelToPythonGlossaryPage = (props: {pageContent: PageContent, glossaryPag
207239
{codeSection.codeLines.join('\n')}
208240
</CodeBlock>
209241
}
210-
{index === 0 && pageContent.mitoCTA !== undefined &&
211-
<div className={pageStyles.background_card} style={{padding: '10px', marginTop: '10px', borderRadius: '10px'}}>
212-
<h3
213-
id={`Mito's ${functionNameShort} function`}
214-
className={classNames(excelToPythonStyles.section_h3_tag, excelToPythonStyles.link)}
215-
style={{marginTop: '5px'}}
216-
>
217-
Use Mito&apos;s {functionNameShort} function</h3>
218-
<p>
219-
Mito is an open source library that lets you write Excel formulas in Python. Either write the formula directly in Python or <Link href='/spreadsheet-automation'><a className={pageStyles.link}>use the {functionNameShort} formula in the Mito Spreadsheet</a></Link> and generate the equivalent Python code automatically.
220-
</p>
221-
<p>
222-
Mito&apos;s {functionNameShort} function works exactly like it does in Excel. That means you don&apos;t need worry about managing data types, handling errors, or the edge case differences between Excel and Python formulas.
223-
</p>
224-
<p>
225-
<a href={MITO_INSTALLATION_DOCS_LINK} target="_blank" rel="noreferrer" className={classNames(pageStyles.link, PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_IN_CONTENT_CTA)}>Install Mito</a> to start using Excel formulas in Python.
226-
</p>
227-
<CodeBlock
228-
className={PLAUSIBLE_COPIED_CODE_MITO_EXPORTED_FUNCTION}
229-
>
230-
{[
231-
"# Import the mitosheet Excel functions",
232-
"from mitosheet.public.v3 import *;",
233-
"",
234-
`# Use Mito's ${functionNameShort} function`
235-
].concat(pageContent.mitoCTA.codeLines).join('\n')}
236-
</CodeBlock>
237-
</div>
238-
}
239242
</>
240243
)
241244
})}

0 commit comments

Comments
 (0)